CSS

1311 bookmarks
Custom sorting
CSS Hyphens, Words, Syllables, and Languages
CSS Hyphens, Words, Syllables, and Languages
There's a newish CSS feature called hyphens that specifies how you want words to be hyphenated when the text wraps. But if you use it, you're going to need to make sure you're also correctly identifying the language. And to understand why that matters, we need to talk about words and syllables.
·blog.frankmtaylor.com·
CSS Hyphens, Words, Syllables, and Languages
The Gap Strikes Back: Now Stylable | CSS-Tricks
The Gap Strikes Back: Now Stylable | CSS-Tricks
Styling the space between layout items — the gap — has typically required some clever workarounds. But a new CSS feature changes all that with just a few simple CSS properties that make it easy, yet also flexible, to display styled separators between your layout items.
·css-tricks.com·
The Gap Strikes Back: Now Stylable | CSS-Tricks
Easier layout with margin-trim
Easier layout with margin-trim
If you write a lot of CSS, you are familiar with those moments when you aren’t quite sure how to accomplish what you want to accomplish.
·webkit.org·
Easier layout with margin-trim
Reducing CSS complexity with the :is() pseudo-class
Reducing CSS complexity with the :is() pseudo-class
Last week, I finally had a reason to use the newish :is() CSS pseudo-class, and wow is it glorious! Today, I want to show you how it can dramatically reduce selector complexity. Let’s dig in! What :is() does The :is() pseudo-class accepts a comma-separated list of selectors, and can be used to group them together. For example, these two selector strings do the same thing… h1, h2, h3, h4, h5, h6 { font-weight: bold; } :is(h1, h2, h3, h4, h5, h6) { font-weight: bold; } You’re probably look at this and thinking…
·gomakethings.com·
Reducing CSS complexity with the :is() pseudo-class
The :empty pseudo-class in CSS
The :empty pseudo-class in CSS
One of my favorite not-so-new aspects of CSS is the :empty pseudo-class. You can use this to target elements that have no children—either child elements or whitespace and text nodes—and style them differently than they would be otherwise. For example, imagine you have some CSS to layout items in a row using flexbox… .grid-flex { display: flex; gap: 1rem; } .grid-flex div { background-color: #ffdc00; border: 1px solid #665800; color: #665800; padding: 1rem 2rem; text-align: center; } And a row of items generated from an API or database or something.
·gomakethings.com·
The :empty pseudo-class in CSS