min-width: attr(foo) /* implicitly requires type to be length */
color: attr(bar) /* implicitly requires type to be color */
Unless you wanted to use a shorthand property like border, but restrict the attribute to only one part of it? border: 1px attr(bdrcolor type(<color>)) /* needs explicit type to prevent specifying border-style */
But that would be easier and cleaner to specify separately? border-width: 1px
border-color: attr(bdrcolor) /* implicitly requires type to be color */
In what scenarios does adding the explicit type information help, rather than having the parser infer the type of the attr() based on the context of the call?CSS variables are another thing to consider perhaps. You can specify their type explicitly as well (albeit using a more verbose syntax):
@property --logo-color {
syntax: "<color>";
inherits: false;
initial-value: attr(logo-color);
}Browser bugs are so cute. Just sitting there for decades, comments accreted over time. Tasks spinning for eternity. These are truly the cicadas of bugs.
pier25•5mo ago
Inviz•5mo ago
chrisandchris•5mo ago
bawolff•5mo ago
taejavu•5mo ago
pier25•5mo ago
derkades•5mo ago
taejavu•5mo ago