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

feat(preset-mini)!: use getComponent for variant parameter #1704

merged 6 commits into from Oct 25, 2022


Copy link

@chu121su12 chu121su12 commented Oct 9, 2022

With getComponent helper, existing variant-x can more safely accept bracket value.

This PR update the api of variant-x to use getComponent, in addition using h.bracket to process the passed parameter.

Breaking changes:

  • Direct values support are now removed and need to be updated to use bracket. Affected variants are:
    • all combinators-x variants
    • selector-x
    • scope-x
      • scope-x no longer defaulted to class; x now must be a qualifying selector
    • all tagged pseudo-x variants
      • group-x, peer-x, parent-x, previous-x
  • media-x variant can still use direct value for theme lookup, but missing key in the theme will no longer generate custom property value
    • this in turn aligns media-x syntax with support-x syntax
  • layer-x and uno-layer-x variants can still use direct value, in addition to bracket due to similarity with css @variant container/parent
  • Values in bracket are handled using h.bracket so previous value of, ex.: variant-[uno_css], needs to be updated to variant-[uno\_css] to account for h.bracket processing
  • Combinator version of tagged pseudo are removed in favor of the pseudo implementation
  • For tagged pseudo, added pseudo/label experimental feature by tailwind. This may be changed down the line.

Edit: added scope-x update
Edit 2: update label syntax

Copy link

netlify bot commented Oct 9, 2022

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f082bf2
🔍 Latest deploy log
😎 Deploy Preview
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu merged commit bf88cb7 into unocss:main Oct 25, 2022
@chu121su12 chu121su12 deleted the feat/get-component branch October 25, 2022 09:54
MellowCo added a commit to MellowCo/unocss-preset-weapp that referenced this pull request Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants