Skip to content

Fix emotion template literal minification#16197

Open
Jakeii wants to merge 5 commits into
mainfrom
jlk/fix-emotion-template-literal-2
Open

Fix emotion template literal minification#16197
Jakeii wants to merge 5 commits into
mainfrom
jlk/fix-emotion-template-literal-2

Conversation

@Jakeii

@Jakeii Jakeii commented Jun 17, 2026

Copy link
Copy Markdown
Member

This is a fixed version of #16184

Which had to be reverted, as there were some unexpected visual changes which weren't flagged by chromatic due to an earlier change that also had to be reverted.

What does this change?

Add the @swc/plugin-emotion plugin

Why?

emotion css using the template literal syntax does not get minified without a babel or swc plugin.

Screenshots

Before After
Screenshot 2026-06-17 at 10 50 47 Screenshot 2026-06-17 at 10 51 04
Screenshot 2026-06-17 at 10 50 41 Screenshot 2026-06-17 at 10 50 58
Screenshot 2026-06-17 at 10 51 27 Screenshot 2026-06-17 at 10 51 16
Screenshot 2026-06-17 at 10 51 42 Screenshot 2026-06-17 at 10 51 50

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

@Jakeii Jakeii force-pushed the jlk/fix-emotion-template-literal-2 branch from 159366f to 6e48705 Compare June 17, 2026 16:28
@Jakeii Jakeii added the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
@Jakeii Jakeii force-pushed the jlk/fix-emotion-template-literal-2 branch from 6e48705 to 04113fe Compare June 18, 2026 08:14
@Jakeii Jakeii added the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
@Jakeii Jakeii added the fix Departmental tracking: fix label Jun 18, 2026
};

const liveBlockContainerStyles = () => css`
const liveBlockContainerStyles = css`

@Jakeii Jakeii Jun 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure how this even worked before, but it doesn't with the swc plugin!

This function wasn't called when used down on line 161

@Jakeii Jakeii changed the title fix emotion template literal minification Fix emotion template literal minification Jun 18, 2026
@Jakeii Jakeii marked this pull request as ready for review June 18, 2026 09:57
@Jakeii Jakeii requested a review from a team as a code owner June 18, 2026 09:57
@Jakeii Jakeii added the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Departmental tracking: fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant