-
Notifications
You must be signed in to change notification settings - Fork 0
Variation At Rule
Tommy Hodgins edited this page Sep 28, 2019
·
2 revisions
A custom at-rule that can wrap one or more CSS rules to conditionally include those rules in the CSS output based on whether the testwrap build varaition matches the supplied value
@--variation <value> { <list of css rules> }
-
<value>
is any value CSS knows about: e.g.5
, or"demo"
-
<list of css rules>
is a list of CSS rules to be added to the CSS output
If you were building a test with --data '{"variation": 1}'
you could conditionally include rules in CSS for this build only that wouldn't appear when built with --data '{"variation": 2}'
with the following:
html {
color: hotpink;
}
@--variation 1 {
html {
background: lime;
}
}
html {
color: hotpink;
}
html {
background: lime;
}
html {
color: hotpink;
}