addVariant and modifySelectors: Adding multiple rules per classname #3840
Unanswered
JaapWeijland
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm trying to make a custom variant to support responsiveness based on a container instead of the media screen. To do that, I want add a variant group called
responsive-container
. This variant should add a variant per screen size. The following is what I expect when the variant is applied to am-4
class:Currently, I do this by iterating over the screens in the theme in the
modifySelectors
callback, and then returning an array with the newly generated selectors. However, when returning such an array, it generates one single CSS rule with multiple selectors:I don't want this because this messes up the CSS rule prioritization. Is there a way to generate the above mentioned rules at ones, instead of generating one giant rule?
Currently, I am using the following plugin to generate the variant:
Beta Was this translation helpful? Give feedback.
All reactions