Distinguish between simple and complex initial values in data/css/properties.json
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 787
- Forks
- 216
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 6
Description
In data/css/properties.json, the initial value can be:
- A simple value, like
0,0% 0%,none, orauto. This used to be wrapped like<code>0</code> - A key into l10n/css.json, like
noneButOverriddenInUserAgentCSSornoPracticalInitialValue. - A list of strings, which are each one of the above. In practice, all current lists appear to be lists of literals.
I've proposed https://github.com/mozilla/kumascript/pull/162 to distinguish between cases 1 and 2, but it would be better to have a clearer signal in the data. Some straw man suggestions:
Different Keys for literal vs. prose initial values. Advantage - unambiguous. Disadvantage - users must update.
"align-self": {
"initialLiteral": "auto"
},
"all": {
"initialProse": "noPracticalInitialValue"
},
"animation": {
"initialLiteral": [
"animation-name",
"animation-duration",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"animation-play-state"
]
}
Prefix for prose value, none for literals. Advantage - same key, quick check for literal vs prose. Disadvantage - pick a universal prefix, users must process to get prose key.
"align-self": {
"initial": "auto"
},
"all": {
"initial": "_prose_:noPracticalInitialValue"
},
"animation": {
"initial": [
"animation-name",
"animation-duration",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"animation-play-state"
]
}
Initial objects instead of strings. Advantage - unambiguous, allows for future expansion, mixing literals and prose. Disadvantage - detect object vs list, overly wordy.
"align-self": {
"initial": {
"value": "auto",
"type": "literal"
}
},
"all": {
"initial": {
"value": "noPracticalInitialValue",
"type": "prose"
}
},
"animation": {
"initial": [
{"value": "animation-name", "type": "literal"},,
{"value": "animation-duration", "type": "literal"},,
{"value": "animation-timing-function", "type": "literal"},,
{"value": "animation-delay", "type": "literal"},,
{"value": "animation-iteration-count", "type": "literal"},,
{"value": "animation-direction", "type": "literal"},,
{"value": "animation-fill-mode", "type": "literal"},,
{"value": "animation-play-state", "type": "literal"},
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing data/css/properties.json and the related l10n/css.json values, then compare the proposed handling in kumascript#162. Decide on a representation that unambiguously distinguishes literal and prose initial values, including lists, and verify that the documented data shape gives consumers enough information to process each case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100