Open fantasai opened 1 month ago
A function computing to a different value depending on which property it's used on is a bit odd and unlike CSS in general.
e.g. height: anchor-size()
and width: anchor-size()
shouldn't compute to different values.
Something more CSS-like would probably be a keyword: height: anchor-size
or height: match-anchor
or similar.
It doesn't seem odd to me. The anchor()
function itself does that also.
My only concern is that if we wanted to allow more information to come in (the anchor's margin, or the anchor's right inset-area track, etc), it might not be as clear what the "default" is.
But I don't think I'm opposed to this, if you think that's reasonable given that sort of possible future development.
So how does block-size match the default value?
block-size: anchor-size()
matches to block-size: anchor-size(block)
?
Does this contain too much magic? It ends up confusing the writer even more.
@yisibl I think this is the obvious interpretation.
The CSS Working Group just discussed [css-anchor-position] anchor-size() argument should be optional
, and agreed to the following:
RESOLVED: Make anchor-size() default to the keyword matching the axis of the property it's used in
The
anchor-size()
function, which is defined as a function of the sizing properties (width/height/etc.) has the following syntax:That means in most cases, authors will be writing something like
height: anchor-size(height)
. This seems silly. Shouldn't the<anchor-size>
argument be optional, defaulting to the dimension matching the sizing property's effect?