Who knows?

I love it when I come across some bit of CSS I’ve never heard of before.

Take this article on the text-emphasis property.

“The what property?”, I hear you ask. That was my reaction too. But look, it’s totally a thing.

Or take this article by David Bushell called CSS Button Styles You Might Not Know.

Sure enough, halfway through the article David starts talking about styling the button in an input type="file” using the ::file-selector-button pseudo-element:

All modern browsers support it. I had no idea myself until recently.

He’s right!

Then I remembered that I’ve got a file upload input in the form I use for posting my notes here on adactio.com (in case I want to add a photo). I immediately opened up my style sheet, eager to use this new-to-me bit of CSS.

I found the bit where I style buttons and this is the selector I saw:

button,
input[type="submit"],
::file-selector-button

Huh. I guess I did know about that pseudo-element after all. Clearly the knowledge exited my brain shortly afterwards.

There’s that tautological cryptic saying, “You don’t know what you don’t know.” But I don’t even know what I do know!

Responses

Beedge

@baldur this happens to me in my job as a developer on a daily basis but on a much larger scale. I have added whole features to my services or apps and then completely forgotten them, to the point that I’ll go to add a cool new bit of functionality only to see it sitting there waiting for me to discover. A gift from my younger self.

# Posted by Beedge on Wednesday, March 27th, 2024 at 10:31am

adamrice

@adactio @Meyerweb The “text-emphasis” property reproduces a customary part of Japanese typesetting. I always wind up reading this kind of dotted text like. There. Is. A. Period. After. Every. Word. Japanese typesetters historically didn’t have access to as many fonts, or font weights and variants, so they pull out all the stops with other types of decoration.

# Posted by adamrice on Thursday, March 28th, 2024 at 3:41pm

adamrice

@adactio @Meyerweb Also, that dotted text looks really weird with a proportional font. Japanese text is always monospaced.

# Posted by adamrice on Thursday, March 28th, 2024 at 3:43pm

8 Shares

# Shared by Ironorchid on Tuesday, March 26th, 2024 at 6:53pm

# Shared by Jakub Iwanowski :bash: on Thursday, March 28th, 2024 at 4:08pm

# Shared by Alexander Rutz on Thursday, March 28th, 2024 at 4:08pm

# Shared by Vanni Di Ponzano 🚴 ❤️ ☕ 🍎 on Thursday, March 28th, 2024 at 4:08pm

# Shared by Eric A. Meyer on Thursday, March 28th, 2024 at 4:08pm

# Shared by bkardell on Thursday, March 28th, 2024 at 4:09pm

# Shared by Jules 🍺 on Thursday, March 28th, 2024 at 5:41pm

# Shared by Rich C on Monday, April 1st, 2024 at 10:34am

14 Likes

# Liked by Sunny :autumnleaf6: on Tuesday, March 26th, 2024 at 7:52pm

# Liked by Giana ✨ on Tuesday, March 26th, 2024 at 9:25pm

# Liked by kriesse on Wednesday, March 27th, 2024 at 1:43pm

# Liked by Jakub Iwanowski :bash: on Thursday, March 28th, 2024 at 4:06pm

# Liked by Alexander Rutz on Thursday, March 28th, 2024 at 4:06pm

# Liked by Zack on Thursday, March 28th, 2024 at 4:07pm

# Liked by Heather Buchel on Thursday, March 28th, 2024 at 4:07pm

# Liked by Eric A. Meyer on Thursday, March 28th, 2024 at 4:07pm

# Liked by bkardell on Thursday, March 28th, 2024 at 4:07pm

# Liked by Paul Hebert on Thursday, March 28th, 2024 at 4:37pm

# Liked by Troels Thomsen on Thursday, March 28th, 2024 at 10:17pm

# Liked by Asbjørn Ulsberg on Friday, March 29th, 2024 at 11:49am

# Liked by kaiserkiwi :kiwibird: on Friday, March 29th, 2024 at 12:23pm

# Liked by stephen on Friday, March 29th, 2024 at 2:58pm

1 Bookmark

# Bookmarked by Ange Chierchia on Sunday, March 31st, 2024 at 1:56pm

Related posts

Displaying HTML web components

You might want to use `display: contents` …maybe.

Progressive disclosure defaults

If you’re going to toggle the display of content with CSS, make sure the more complex selector does the hiding, not the showing.

Schooltijd

Going back to school in Amsterdam.

Making the Patterns Day website

The joy of getting hands-on with HTML and CSS.

Assumption

Separate your concerns.

Related links

With great power, comes great creativity: thoughts from CSS Day 2024 · Paul Robert Lloyd

Here’s Paul’s take on this year’s CSS Day. He’s not an easy man to please, but the event managed to impress even him.

As CSS Day celebrates its milestone anniversary, I was reminded how lucky we are to have events that bring together two constituent parties of the web: implementors and authors (with Sara Soueidan’s talk about the relationship between CSS and accessibility reminding us of the users we ultimately build for). My only complaint is that there are not more events like this; single track, tight subject focus (and amazing catering).

Tagged with

Printing music with CSS grid

Laying out sheet music with CSS grid—sounds extreme until you see it abstracted into a web component.

We need fluid and responsive music rendering for the web!

Tagged with

How would you build Wordle with just HTML and CSS? | Scott Jehl, Web Designer/Developer

This is a great thought exercise in progressive enhancement …that Scott then turns into a real exercise!

Tagged with

CSS :has() Interactive Guide

This isn’t just a great explanation of :has(), it’s an excellent way of understanding selectors in general. I love how the examples are interactive!

Tagged with

Retrofitting fluid typography | Clagnut by Richard Rutter

Here’s a taste of what Rich will be delivering at Patterns Day on Thursday���can’t wait!

Tagged with

Previously on this day

4 years ago I wrote Apple’s attack on service workers

Kiss your service workers goodbye on iOS.

9 years ago I wrote 100 words 004

Day four.

15 years ago I wrote Boarding

I’m mobile. Fly me.

18 years ago I wrote Darwinian webolution

Websites aren’t built; they’re grown.

22 years ago I wrote New Arrival

Jessica’s iMac arrived yesterday.