{"id":304543,"date":"2020-03-03T08:18:04","date_gmt":"2020-03-03T15:18:04","guid":{"rendered":"https:\/\/css-tricks.com\/?p=304543"},"modified":"2020-03-04T06:39:31","modified_gmt":"2020-03-04T13:39:31","slug":"making-things-better-redefining-the-technical-possibilities-of-css","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/making-things-better-redefining-the-technical-possibilities-of-css\/","title":{"rendered":"Making Things Better: Redefining the Technical Possibilities of CSS"},"content":{"rendered":"\n
Robin recently lamented the common complaint that CSS is frustrating<\/a>. There are misconceptions about what it is and what it does. There are debates about what kind of language it is. There are even different views on where<\/em> it should be written.<\/p>\n\n\n\n Rachel Andrew has a new talk<\/a> from An Event Apart DC 2019<\/a> available that walks us back; back to the roots of the issues we used to have with CSS and the “hacks” we used to overcome them. CSS has changed a lot over the past few years and, while those changes have felt complex and confusing at times, they are designed to solve what we have always wanted CSS to do.<\/p>\n\n\n\n\n\n\n\n The full hour it takes to watch the talk is well worth the time. Here are a few nuggets that stood out. First off, some de-bunking of common CSS complaints:<\/p>\n\n\n\n Rachel continues by giving us a peek into the future of what CSS wants to do for us:<\/p>\n\n\n\nsafe<\/code> and
unsafe<\/code> will give us extra control to define whether we want CSS to aggressively avoid content that’s unintentionally hidden or allow it to happen.<\/li><\/ul>\n\n\n\n
.container {\n display: flex;\n flex-direction: column;\n \/* Please center as long as it doesn't result in overflow *\/\n align-items: safe center;\n}<\/code><\/pre>\n\n\n\n
min-content<\/code> and
max-content<\/code> keywords make it possible to create boxes that are wide enough for the content but not wider, and boxes that are as big as the content can be.<\/li><\/ul>\n\n\n\n
.container {\n width: min-content; \/* Allow wrapping *\/\n}<\/code><\/pre>\n\n\n\n