Scoping the wrong query?

The RICG has a new fight: CSS container queries. The article's ignited discussion, beneficially. The problem is legitimate, the reasoning well argued and the solution intriguing. But something's niggling me. Element queries won't work for the various reasons given, but they're also ugly.

Which got me thinking. Why not scope the query to the property, not the element? Why write:

.mod:media( min-width: 40em ){
    align: left;
}

.mod {
    align: right;
}

When you could write:

.mod {
    align::media( min-width: 40em ): left;
    align: right;
}

Still ugly, sure, but I'd rather have repetition in my attributes than in my elements. It's a more orderly ugly.

TBC: I'm aware RICG have taken another direction; just a brain worm I needed to squash.

Explore Other Articles

Newer

Elephant in the room

Memory augmentation has always interested me. I'm envious of those that never forget a name or can quote verbatim. Like Mark Llobrera, I've started using technology to never …

Conversation

Want to take part?

Comments are powered by Webmentions; if you know what that means, do your thing 👍

  • <!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>The RICG has a new fight: CSS container queries. The article's ignited discussion, beneficially. The problem is legitimate, the reasoning well argued and the solution intriguing. But something's …</p> </body> </html>
  • Murray Champernowne.
Article permalink