-
Notifications
You must be signed in to change notification settings - Fork 715
Some property definitions for shorthands should not say 'see individual properties' #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am not sure I understand what it implies for shorthand to be described as having initial values, instead of just defering that to their longhands. It terms of cascading and inheritance, only longhand initial values matter. The 'initial' keyword can be described in a way that makes it work for shorthand in terms of its longhangs, without them having an independent initial value. For documentation and teaching purposes, expressing directly what the initial value of a shorthand is may be useful, but it is fully a consequence of the longhand values, not a separate normative requirement, so it feels it would belong in a note of some kind. Or am I missing something? |
As far as I know, there is currently no shorthand having a different value as its longhands, though a shorthand may have an initial value that doesn't refer to its longhands.
It could have had @frivoal what about the other property definitions mentioned above? Sebastian |
An initial value is used solely to:
In either case, shorthands don't exist at that time. They go away during parsing, expanded into their constituent longhands. There is nothing for a shorthand's initial value, if it had one, to do. |
Whether or not
What about them? The initial values of the flex and font property you describe do not exist independently of the initial values of the longhands. “The initial value of the flex property is 1 0 auto” is nothing more than a shortcut way of saying “The initial values of the flex-grow flex-shrink and flex-basis properties are respectively 1, 0 and auto”. |
Right, the mapping between the keyword and the initial values of the longhands is obligatory. As we didn't have a precedent for this yet, I'm conviced now that having 'see individual properties' is the right choice here.
I meant 'Applies to', 'Inherited', 'Media' and 'Computed value'. There must be a reason why the basically all spec. editors do it differently ‒ including Tab's and your specifications ‒ than what @tabatkins wrote in speced/bikeshed#734 (comment). Sebastian |
While I am an editor of Animations, I did not write the spec, and am not directly responsible for that propdef. (But you might still be able to find one where I did write a shorthand in an inconsistent way; I forget sometimes.) |
I did that for the flex properties because they are recommended over the longhands in nearly all cases. I don't mind to revert that, though I think it's more helpful to authors when that information is readily available given we don't want authors to even know about the longhands in this case... Note this does not hold true for most other shorthands. |
The general rule is here: https://lists.w3.org/Archives/Public/www-style/2016May/0044.html, which says “fill in the shorthand propdef table's field if all sub-properties have the same value”. |
Uh oh!
There was an error while loading. Please reload this page.
@tabatkins mentioned earlier that shorthands don't have an initial value.
I believe this statement is wrong. Shorthands do have initial values, which are a normally a combination of their longhands. Also, they apply to a specific group of elements, they are inherited or not, they apply to a specific media and have a computed value.
So, their property definitions for 'Initial', 'Applies to', 'Inherited', 'Media' and 'Computed value' should be set accordingly.
Examples:
The
font
shorthand has an initial value ofnormal normal normal normal 20px / normal arial
(and not one of the possible keyword values), it applies to all elements, it is inherited, applies to visual media and has a computed value of<‘font-style’> <‘font-weight’> <‘font-stretch’> <‘font-size’> / <‘line-height’> <‘font-family’>
(browsers are inconsistent regarding that).The
flex
shorthand has an initial value of0 1 auto
, it applies to flex items, it is not inherited, applies to visual media anad has a computed value of<‘flex-grow’> <‘flex-shrink’> <‘flex-basis’>
(and notnone
).Sebastian
The text was updated successfully, but these errors were encountered: