CSS polyfills from the future | GSS
Web developers are expected to build increasingly sophisticated UIs faster, cheaper, with tools that have not evolved with the times. Why is the trivial task of centering an element with CSS so obtusely complex? CSS was designed to separate presentation from content, but even with Flexbox, a trivial change in layout can require deep changes in both the HTML content and the CSS presentation. CSS layout primitives are not expressive enough - it doesn’t really matter that some div is 720px wide - what matters is how it relates to other elements in the layout. WTF, why can’t we position & size elements relative to each other, not just relative to their positioned parents? For more than a decade, web developers have been asking for this, but the W3C refuses to tackle the engineering problems associated with the “cyclic dependencies” that naturally arise in relative layout logic. Sounds like a classic constraint satisfaction problem - JavaScript to the rescue! GSS is a CSS preprocessor & JS
Web developers are expected to build increasingly sophisticated UIs faster, cheaper, with tools that have not evolved with the times. Why is the trivial task of centering an element with CSS so obtusely complex? CSS was designed to separate presentation from content, but even with Flexbox, a trivial change in layout can require deep changes in both the HTML content and the CSS presentation. CSS layout primitives are not expressive enough - it doesn’t really matter that some div is 720px wide - what matters is how it relates to other elements in the layout. WTF, why can’t we position & size…
saved by
related reading
- Understanding Layout Algorithms • Josh W. Comeaujoshwcomeau.com
- An Interactive Guide to Flexbox in CSS • Josh W. Comeaujoshwcomeau.com
- Web Field Manual | Codewebfieldmanual.com
- Cheng Lou on X: "My dear front-end developers (and anyone who’s interested in the future of interfaces): I have crawled through depths of hell to bring you, for the foreseeable years, one of the more important foundational pieces of UI engineering (if not in implementation then certainly at https://t.co/BKnwCDIp75" / Xx.com
- What will you ship?rauno.me
- A Complete Guide to CSS Concepts and Fundamentalstania.dev
- Inside Framer's Magic Motionnan.fyi
- How to organize CSS @ 9elements9elements.com
- The Design of This Websiteturntrout.com
- Flexbox | Codropstympanus.net
- Flexbox Froggyflexboxfroggy.com
- Cascading Style Sheets, designing for the Web – Chapter 3: The amazing em unit and other best practicesw3.org