3 ms·
What an amazing article. Thanks for sharing. I've been wondering for some time now whether CSS should have a formal semantics to help implementations, and for
by tannhaeuser 9y ago
What an amazing article. Thanks for sharing.
I've been wondering for some time now whether CSS should have a formal semantics to help implementations, and for posteriority (eg. not leaving behind a mess of specs making it infeasible to implement browsers from scratch/specs for generations to come).
For an example of what I'm after, see [1], which is using attribute grammars/logic grammars for a small fragment of CSS box layout, and is one of the precious few attempts of a formal semantics for CSS.
[1]: https://lmeyerov.github.io/projects/pbrowser/pubfiles/extended.pdf https://lmeyerov.github.io/projects/pbrowser/pubfiles/extend...
- thinkMOAR 9y agoThe above, plus i did not know about 'rem'. And now i do, thanks for that.
- Manishearth 9y agoThere are a bunch more interesting ones that folks often haven't heard of, like ex (relative to the height of an x) or ch (relative to the width of a 0) https://developer.mozilla.org/en-US/docs/Web/CSS/length https://developer.mozilla.org/en-US/docs/Web/CSS/length (not all of the ones in that page are implemented by browsers, e.g. I don't think anyone implements `cap` or `ic` since it's from a draft spec)