Open fantasai opened 3 years ago
Avoiding the maintenance headache of almost-the-same descriptor blocks sounds good in principle.
Should that be added as a general feature of @-rules
or is it okay to just define it in @counter-style
and @font-face
(and potentially @ont-feature-values
and @font-palette-values
)?
As a very weak counter-argument, SVG at one time had a feature in gradients to make them extend other gradients; which could lead to lengthy chains of gradients extending other gradients extending other gradients, and was not liked by implementers especially when animated.
(Of course, descriptors can't be animated)
I don't think this should be a general feature; it's additional impl complexity that isn't particularly needed for most rules. But font-faces do the "multiple at-rules that are nearly identical" thing a lot more than counter-styles do, especially as we add more of these controlling descriptors.
Is there any evidence that authors have found descriptor duplication in font-face rules annoying enough to have created tooling for this case?
There was none found for https://github.com/w3c/csswg-drafts/issues/3691, which was something I floated a while back that had a similar goal.
The CSS Working Group just discussed [css-fonts-5] Consider 'extends' descriptor to reduce duplicate declarations
.
CSS Counter Styles has an
extends
descriptor that basically copies all the descriptors of a different@counter-style
rule and lets this@counter-style
rule override specific ones rather than repeating them all. See https://www.w3.org/TR/css-counter-styles-3/#extends-systemIt might make sense to copy that system over to
@font-face
, to make it easy to tweak the definitions of a common font face into multiple variants?