You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variants, rules and shortcuts supports syntax that allows to access RuleContext object that contains active theme and other useful information. Safelist for some reason doesn't support such syntax which prevents generating safelist based on main project configuration.
Suggested solution
I will provide a practical example why access to theme might be needed.
Let's suppose we want to generate safelist for utility on all media breakpoints specified in the project.
In theme we may have something like this:
At the moment I have to manually import needed data from a JSON file but this is inflexible solution taking into account that my project uses Nuxt layers where every layer potentially can override/augment Uno theme object. So breakpoints as any other parts of config are determined only once unocss:config Nuxt hook was executed.
Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
AndrewBogdanovTSS
changed the title
Safelist values should have access to RuleContext
[Feature Request] - Safelist values should have access to RuleContext
Jan 26, 2024
AndrewBogdanovTSS
changed the title
[Feature Request] - Safelist values should have access to RuleContext
[Feature Proposal] - Safelist values should have access to RuleContext
Jan 26, 2024
Clear and concise description of the problem
Variants, rules and shortcuts supports syntax that allows to access RuleContext object that contains active theme and other useful information. Safelist for some reason doesn't support such syntax which prevents generating safelist based on main project configuration.
Suggested solution
I will provide a practical example why access to theme might be needed.
Let's suppose we want to generate safelist for utility on all media breakpoints specified in the project.
In theme we may have something like this:
than I would like to access those screens in my safelist to generate utility on those resolutions
sagelist should allow such syntax:
Alternative
At the moment I have to manually import needed data from a JSON file but this is inflexible solution taking into account that my project uses Nuxt layers where every layer potentially can override/augment Uno theme object. So breakpoints as any other parts of config are determined only once
unocss:config
Nuxt hook was executed.Additional context
No response
Validations
README.md
of using the package.The text was updated successfully, but these errors were encountered: