Tags: property

5

sparkline

Thursday, July 18th, 2024

Get the screen width & height without JavaScript

Clever!

Wednesday, April 3rd, 2024

Hanging punctuation in CSS

There’s a lovely CSS property called hanging-punctuation. You can use it to do exactly what the name suggests and exdent punctuation marks such as opening quotes.

Here’s one way to apply it:

html {
  hanging-punctuation: first last;
}

Any punctuation marks at the beginning or end of a line will now hang over the edge, leaving you with nice clean blocks of text; no ragged edges.

Right now it’s only supported in Safari but there’s no reason not to use it. It’s a perfect example of progressive enhancement. One line of CSS to tidy things up for the browsers that support it and leave things exactly as they are for the browsers that don’t.

But when I used this over on The Session I noticed an unintended side-effect. Because I’m applying the property globally, it’s also acting on form fields. If the text inside a form field starts with a quotation mark or some other piece of punctuation, it’s shunted off to the side and hidden.

Here’s the fix I used:

input, textarea {
  hanging-punctuation: none;
}

It’s a small little gotcha but I figured I’d share it in case it helps someone else out.

Monday, March 6th, 2023

The Web Needs a Native .visually-hidden

I agree with the reasoning here—a new display value would be ideal.

Wednesday, March 23rd, 2022

The Laboratorium (2d ser.) (I Do Not Think That NFT Means What You Think It…)

The bottom line is that almost everything NFT advocates want to do on a blockchain can be done more easily and efficiently without one, and the legal infrastructure needed to make NFTs work defeats the point of using a blockchain in the first place.

Saturday, January 8th, 2022

The Technium: Ideas Want to be Shared

The books I have written are created from words invented by others, filled with ideas created by others. Even the few new ideas that are new depend on older ideas to work. What I had to say would probably be said by someone else not long after me. (More probably there have already been said by someone I was not aware of.) I may be the lucky person to claim those rare new ideas, but the worth of my art primarily resides in the great accumulation of the ideas and works of thousands of writers and thinkers before me — what I call the commons. My work was born in the commons, it gets its value by being deeply connected to the commons, and after my brief stewardship of those tiny new bits, it should return to the commons as fast as possible, in as many ways as possible.