CSS Conditional Rules Module Level 3 out now

New specification adds useful capabilities

New specification adds useful capabilities

The first draft of the CSS Conditional Rules Module Level 3 has been published. The specification permits conditional group rules to contain other @-rules, and defines two new types of conditional group rules: @supports and @document.

From the introduction: "[CSS21] defines one type of conditional group rule, the ‘@media’ rule, and allows only rulesets (not other @-rules) inside of it. The ‘@media’ rule provides the ability to have media-specific style sheets, which is also provided by style sheet linking features such as ‘@import’ and <link>. The restrictions on the contents of ‘@media’ rules made them less useful; they have forced authors using CSS features involving @-rules in media-specific style sheets to use separate style sheets for each medium.

"This specification extends the rules for the contents of conditional group rules to allow other @-rules, which enables authors to combine CSS features involving @-rules with media specific style sheets within a single style sheet.

"This specification also defines additional types of conditional group rules, ‘@supports’ and ‘@document’, to address author and user requirements.

"The ‘@supports’ rule allows CSS to be conditioned on implementation support for CSS properties and values.

"The ‘@document’ rule allows CSS to be conditioned on the page to which the style sheet is being applied."

While this development is welcomed by many, there is some division of opinion over whether this strategy is good practice. Web standards guru Molly E. Holzschlag summarised the situation thus:

"CSS Conditional Rules address a variety of needs that need addressing. I've heard a lot of folks say that they'd prefer conditions in their CSS rather than HTML documents, which makes sense from a pragmatic standpoint.

"Where I think things get sticky is that the more conditions we add to CSS, the more programmatic it becomes, and that in my opinion is the core concern. Designers are rightfully concerned that it will be out of their skill or interest range. Developers are equally correct in questioning whether these tasks belong in CSS at all, keeping CSS in the realm of declarative rather than programmatic techniques and processing. Some fall in the middle, just hoping a solution will come along that's interoperable, easy and quick to implement."

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

TOPICS

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq. 

Latest in Web Design
A screenshot of the new YouTube UI
Yes, YouTube has a new UI. Yes, it's terrible
Adobe XD logo
It seems Adobe's given up on UI design (for now)
Adobe Muse
Why Adobe is frustrating web designers
Dropbox Relay interface with photo of man running
How Dropbox Replay is helping designers future-proof their practice
UX revolution
From 2D to 3D: How brands can harness the latest UX/UI revolution
Personal portfolio of Julie Bonnemoy with a retro vibe
From AI to no-code: The top web design trends for 2024 according to Designmodo
Latest in News
Unity Gaming Report 2025; a small tugboat sails into the sunset
GDC 2025: AI isn't the 'creative cure-all' that some hoped
Samsung Galaxy Tab S9+ deal
Samsung Galaxy tablets get huge price cut in Best Buy's Tech Fest sale – save up to $300
WWDC 2023
Apple's "ugly and embarrassing" AI debacle is causing tension in the company
Substance 3D Painter GDC 2025 reveal; a 3D model of a dragon
GDC 2025: Adobe Substance 3D Painter gets a small but important feature
Horizon&#039;s Aloy getting ready to shoot an arrow
Horizon actress “worried” for the future of gaming after Sony's AI Aloy controversy
Absolut vodka
Why Absolut's 'bottle' print ad is the greatest of all time