Today I learned...

Quick bits of CSS, a pernickity way JS works, an important new way to think about HTML…if you didn’t know before today, there are probably other people here who want to learn it too!

I’ll start the topic off:

A tiny modern CSS progressive enhancement is the use of text-wrap: pretty which prevents typography “orphans” by evaluating the last four lines in a text block and makes adjustments so the last line has two or more words.

Learned from SmolCSS. I’ll be using that one immediately!

3 Likes

FYI, text-wrap: pretty is not supported in Mozilla Firefox or Apple Safari.

1 Like

today I learned not one but two useful things about text:pretty! XD

The future is re-writing text with an LLM so it lines up nicely.

TIL I learned about ~/.bash_logout, a shell script that runs just before you log out on a MEWNIX system that uses the bash shell.

i just learned about the CSS pseudoclass :focus-within !

there’s a dropdown menu on one of my pages that was broken with keyboard navigation, but this fixes it :+1:

2 Likes

the other day i learned about the popover html element! fantastic! gonna use this so much hahaha.

1 Like

oh NICE, I’m well proud of the code I use (on several of my sites) to do this, but a whole html element for it, that’s so useful.

Not as pretty (sorry) but better supported: CSS text-wrap: balance | Can I use... Support tables for HTML5, CSS3, etc

Particularlly useful for headlines.