jensimmons / cssremedy

Start your project with a remedy for the technical debt of CSS.
Mozilla Public License 2.0
2.19k stars 113 forks source link

Audio tag without controls should not be `display:block` #75

Closed mirisuzanne closed 3 years ago

mirisuzanne commented 4 years ago

I think it's generally good to include audio in the list of Embedded Elements that we display as block, with responsive sizing and vertical alignment. But browsers hide audio:not([controls]) by default, and I think it's a mistake for us to override that setting.

I'm not sure about the right solution. If we change that selector to audio[controls] or even just [controls] we're adding more specificity than we use elsewhere.

We need CSS Layers so that we can not worry about specificity in cases like this. 😛

jaandrle commented 4 years ago

What about this naive approach?

audio{ … }
/* just recover default browser behaviour  */audio:not[controls]{display:none;}

Of course, the specificity problem is still there, but at least is concentrated in "specific situation" which we rarely need to change (I guess).