CSS WG Blog New CSS Module: Conditional Rules Level 3

This is a page from the Cascading Style Sheets Working Group Blog. Some other places to find information are the “current work” page, the www-style mailing list, the Future of CSS syndicator, and the issue list on Github.

Do you want to know how the CSS WG works? Fantasai has written about:csswg, An Inside View of the CSS Working Group at W3C.

New CSS Module: Conditional Rules Level 3

By fantasai September 3, 2011 (Permalink)
Categories: publications

Posting on behalf of L. David Baron:

CSS Conditional Rules Level 3 has been published as the first public working draft of the CSS Conditional Rules Module. To quote from its introduction:

CSS 2.1 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 rules, 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 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. This rule makes it much easier for authors to use new CSS features and provide good fallback for implementations that do not support those features. This is particularly important for CSS features that provide new layout mechanisms, and for other cases where a set of related styles needs to be conditioned on propertysupport.

The @document rule allows CSS to be conditioned on the page to which the style sheet is being applied. This allows users to apply styles to a particular page or group of pages, which greatly increases the power of user style sheets.

The CSS working group welcomes comments on this specification. The preferred place for them is the www-style mailing list. Please start the subject line of your message with the spec code[css3-conditional] and include a summary of your comment.

-David

« Previous article Next article »

[Photo: group photo of the CSS working group in San Francisco] Contact: Bert Bos
Copyright © 2020 W3C®

Last updated 2011-09-03 01:13:49