CSS WG Blog front page

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, and the Future of CSS syndicator.

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.

CSS3 Media Queries reaches Recommendation

By Florian Rivoal June 19, 2012 (Permalink)
Categories: publications

The CSS Working Group has published Media Queries as a Recommendation.

Media Queries allows authors to tailor the style that they want to apply to a document based on characteristics of the environment the document is being rendered in.

There were no changes since PR.

As always, please send feedback to the (archived) public mailing list www-style@w3.org (see instructions). When sending e-mail, please put the text [css3-mediaqueries] in the subject if your comments are about mistakes in this document, or [css4-mediaqueries] for other discussions about Media Queries.

Alternatively you can email one of the editors and ask them to forward your comment.

How to unprefix -webkit-device-pixel-ratio

By fantasai June 14, 2012 (Permalink)
Categories: Best Practices

Once upon a time, Webkit decided a media query for the screen resolution was needed. But rather than using the already-standardized resolution media query, they invented -webkit-device-pixel-ratio. The resolution media query can take “dots per inch” and “dots per centimeter”, while -webkit-device-pixel-ratio takes “dots per px”. But these are all fundamentally the same thing because 1in = 96px = 2.54cm. (Granted, not all of this was well-understood in 2006, so we can forgive Webkit for making something up.)

So to unprefix -webkit-device-pixel-ratio all you have to do is convert it to resolution—which is already implemented by all the other browsers. The easiest way is to multiply the value by 96 and append dpi. Like this:

@media (-webkit-min-device-pixel-ratio: 2), /* Webkit */
       (min-resolution: 192dpi)             /* Everyone else */ {
...
}

But wait! you say. I don’t want to do math! Can’t the CSSWG standardize device-pixel-ratio so I don’t have to do math? We could… but then we’d have two features that do exactly the same thing. And typing device-pixel-ratio is awkard, isn’t it? So instead, we added the dppx unit to mean “dots per px”. This way, we can avoid dpi math not just in media queries, but anywhere else that takes a <resolution>, too. Instead of having to add a new device-pixel-resolution query, browsers can just implement the new dppx unit (which is already in CR) for the old resolution query. Then you can just write (min-resolution: 2dppx).

Some caveats: Several early implementations of resolution use the device’s physical resolution rather than its CSS resolution, and in these resolution: 192dpi is not necessarily equivalent to -webkit-device-pixel-ratio: 2. (This is likely to be more of a problem for ratios less than 2.) Since all implementations that support dppx will do so correctly, you can target them by using dppx rather than dpi.

@media (-webkit-min-device-pixel-ratio: 1.5), /* Webkit */
       (min-resolution: 1.5dppx)              /* The Future */
...
}

Flexbox Last Call, Box Alignment First Draft

By fantasai June 13, 2012 (Permalink)
Categories: publications

Today the CSS Working Group published a Last Call Working Draft of the CSS Flexible Box Layout Module and a First Public Working Draft of the CSS Box Alignment Module Level 3.

Flexbox is a new layout model for CSS. The contents of a flex container can be laid out in any direction, can be reordered, can be aligned and justified within their container, and can “flex” their sizes and positions to respond to the available space. We expect this model to be particularly useful for UI layouts.

Box Alignment defines a common set of properties for aligning boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. In particular, it attempts to provide the horizontal and vetical alignment capabilities missing from CSS block layout and to tie that together with alignment models in tables, grid, and flexbox.

Box Alignment is in the unstable “exploratory” stages of design. However the property names and their effect on flex elements is at Last Call in the CSS Flexible Box Layout module, and will be frozen when that advances to Candidate Recommendation.

The CSS Flexible Box Layout Module is now in Last Call. The deadline for comments is 3 July 2012. There have been many significant changes since the last Working Draft: all of the alignment properties were renamed to coordinate with the Box Alignment module, and substantial parts of the algorithm have been rewritten for clarity and error-correction. We strongly encourage anyone interested in this module to review the draft and send in comments ASAP so that we can process them into a Candidate Recommendation by early July.

As always, please send feedback to the (archived) public mailing list www-style@w3.org with the appropriate spec code ([css3-flexbox] or [css3-align]) and your comment topic in the subject line. (Alternatively, you can email one of the editors and ask them to forward your comment.)

Minutes and Resolutions Telecon 2012-06-06

By fantasai June 6, 2012 (Permalink)
Categories: resolutions

Minutes and Resolutions Telecon 2012-05-30

By fantasai May 30, 2012 (Permalink)
Categories: resolutions

Full minutes

Minutes and Resolutions Telecon 2012-05-23

By fantasai May 30, 2012 (Permalink)
Categories: resolutions

Full minutes

Minutes and Resolutions Hamburg F2F May 2012: Miscellaneous

By fantasai May 19, 2012 (Permalink)
Categories: resolutions

Administrative and Testing

Full minutes

XSL:FO and CSS3 Layout

Full minutes

Spec Editing

Full minutes

Minutes and Resolutions Hamburg F2F May 2012: Text Layout and Typography

By fantasai May 19, 2012 (Permalink)
Categories: resolutions

CSS3 Text

CSS3 Writing Modes

CSS3 Fonts

Full minutes: Writing Modes and Text, Fonts

Minutes and Resolutions Hamburg F2F May 2012: Shaping and Paging Flows

By fantasai May 19, 2012 (Permalink)
Categories: resolutions

Regions

Alan and Florian presented several ideas for generating styleable
pseudo-elements to hold content flows:

There was consensus to replace all the examples in Regions with some combination of the above techniques. There was also consensus that the proposals need to be developed further, and that overlap and interaction among them needs to be carefully considered.

Shapes and Exclusions

GCPM

Fragmentation

Full minutes: Regions, Shapes, and Exclusions, GCPM and Fragmentation

Minutes and Resolutions Hamburg F2F May 2012: Layout, Values and Units

By fantasai May 19, 2012 (Permalink)
Categories: resolutions

Box Alignment

fantasai presented a proposal to converge all layout models on a single set of alignment properties.

Grid Layout

Values and Units

Full minutes: Box Alignment and Grid Layout, Values and Units

Older articles »

Archives

(Also available as Atom news feed.)

Browse by date:

Browse by category:

[Photo: group photo of the CSS working group in Lyon, France] Contact: Bert Bos
Copyright © 2011 W3C®

Last updated 2012-06-19 15:35:54

  翻译: