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

variables are incorrectly minified #2279

Closed
4 tasks done
jheng-jie opened this issue Feb 28, 2023 · 4 comments · Fixed by #2286
Closed
4 tasks done

variables are incorrectly minified #2279

jheng-jie opened this issue Feb 28, 2023 · 4 comments · Fixed by #2286
Assignees

Comments

@jheng-jie
Copy link

UnoCSS version

0.50.1

Describe the bug

  • 0.50.1
:root {
  --un-pan-x:;--un-pan-y:;--un-pinch-zoom:;
}
  • 0.49.4
:root {
  --un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;
}

Reproduction

  • similar

svelte#7288
esbuild#760

System Info

legacy browser will fail to resolve the variable

Validations

@antfu
Copy link
Member

antfu commented Feb 28, 2023

We temporarily close this due to the lack of enough information.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Feb 28, 2023
@antfu
Copy link
Member

antfu commented Feb 28, 2023

UnoCSS does not normally touches your CSS. Please provide a proper production.

@jheng-jie
Copy link
Author

jheng-jie commented Mar 1, 2023

@antfu sorry

Reproducible

I found out that it is the problem of transformerDirectives

0.49.4 or turn off transformerDirectives will not be wrong

export default defineNuxtConfig({
  unocss: {
    transformers: [
      // variables are incorrectly minified
      transformerDirectives(),
    ],
    presets: [UnoPreset()],
  },
})
  • steps to reproduce

    1. yarn generate
    2. cd .output/public/_nuxt/
    3. cat entry.{hash}.css

@sibbng sibbng reopened this Mar 1, 2023
@sibbng
Copy link
Member

sibbng commented Mar 1, 2023

I confirm this is a regression introduced in #2229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants