-
Notifications
You must be signed in to change notification settings - Fork 734
Closed
Labels
css-nesting-1Current WorkCurrent Work
Description
Spec: https://drafts.csswg.org/css-nesting/#conditionals (?)
Could we allow nesting @media
at-rules inside @font-face
?
My use case would be conditionally loading a hinted or unhinted font:
@font-face {
font-family: 'The Font';
src: url(the-font-hinted.woff2);
@media (resolution >= 2x) {
src: url(the-font-unhinted.woff2);
}
}
Without nesting support (or if()
support, see #11941), we have to needlessly repeat the unchanged descriptors:
@media (resolution < 2x) {
@font-face {
font-family: 'The Font';
src: url(the-font-hinted.woff2);
}
}
@media (resolution >= 2x) {
@font-face {
font-family: 'The Font';
src: url(the-font-unhinted.woff2);
}
}
This isn’t DRY and is annoying when there are a lot of @font-face
rules.
andruud
Metadata
Metadata
Assignees
Labels
css-nesting-1Current WorkCurrent Work