Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: minify multi-line values in output #265

Open
ahmadsoe opened this issue Oct 27, 2022 · 1 comment
Open

core: minify multi-line values in output #265

ahmadsoe opened this issue Oct 27, 2022 · 1 comment
Assignees
Labels
💅 enhancement New feature or request

Comments

@ahmadsoe
Copy link

Multi-line string values with backtick like this:

const useClasses = makeStyles({
  root: {
    backgroundImage: `repeating-linear-gradient(
      -45deg,
      red,
      red 5px,
      blue 5px,
      blue 10px
    );`
  }
});

will produce as it is (including line breaks) on SSR.

2022-10-27_300_2

Not sure if this should be handled on Griffel's side, the other rules were joined in 1 line like they're minified. How about this case?

It's a real usage in Fluent UI:
https://github.com/microsoft/fluentui/blob/9cbf82e22c21e744601adcd6a3d064e406d015d8/packages/react-components/react-slider/src/components/Slider/useSliderStyles.ts#L146-L152

repro: https://codesandbox.io/s/next-griffel-ssr-4jtx2h?file=/pages/index.js

@layershifter layershifter added the 💅 enhancement New feature or request label Oct 31, 2022
@layershifter layershifter changed the title Format multi-line values on ssr core: minify multi-line values in output Oct 31, 2022
@layershifter
Copy link
Member

@ahmadsoe thanks for reporting 👍

It's what I also noticed before. It's a problem in our dependency, I reported the issue there: thysultan/stylis#306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants