-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Much to my surprise, since @supports
is bubbling like @media
, it seems that you can’t use any arbitrary string as a variable value for it.
While
@min768: ~"(min-width: 768px)";
.element {
@media @min768 {
font-size: 1.2rem;
}
}
results in
@media (min-width: 768px) {
.element {
font-size: 1.2rem;
}
}
Escaping a string with @supports
@test: ~"(font-variant-caps: small-caps)";
.small-caps {
@supports @test {
font-variant-caps: small-caps;
}
}
results in
@supports @test {
.small-caps {
font-variant-caps: small-caps;
}
}
It failed in any implementation I tried (more or less 20) so I guess this is probably a core issue/feature request?
Is this result to be expected?
Problem is you can have awful feature queries like
@supports ((-ms-font-feature-settings: 'dlig') or (-webkit-font-variant-ligatures: discretionary-ligatures) or (font-variant-ligatures: discretionary-ligatures))
and escaping would be very welcome for such cases, especially as people discover @supports
with the grid spec, Open Type features and stuff.