Re: [css-regions] Changed @region rule to ::region() pseudo-element

On May 13, 2013, at 5:55 PM, Alan Stearns <stearns@adobe.com> wrote:

> Hey all,
> 
> Following the discussion in the earlier thread [1] about the similarities
> between region styling and the ::distributed() pseudo-element, I have
> changed the @region rule to a ::region() functional pseudo-element. Now if
> you want to use region styling to set the color of a fragment of an
> element with 'class=bar' that displays inside a CSS Region with 'id=foo'
> you can use:
> 
> #foo::region(.bar) {
>  color: red;
> }
> 
> I've removed the CSSOM section on the CSSRegionStyleRule interface.
> 
> This addresses issue 16859 [2] which urged us to reconsider using a
> pseudo-element for region styling, by reconsidering and actually using a
> pseudo-element for region styling.
> 
> This addresses issue 15734 [3] by defining the specificity of the
> ::region() pseudo-element in the same way that ::distributed() will be
> specified. This makes it a bit easier for region styling to 'win' in the
> cascade.
> 
> And I've closed issue 15713 [4] as the region styling section now makes
> the interaction between region styling and the content fragments much more
> clear. Clarifications on how region styling interacts with an element's
> computed style have been part of the CSSOM section for a while.
> 
> Please take a look at the revised section [5]. Any suggestions for
> improvements are welcome.
> 
> Thanks,
> 
> Alan
> 
> [1] http://lists.w3.org/Archives/Public/www-style/2013Apr/0410.html
> [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=16859
> [3] https://www.w3.org/Bugs/Public/show_bug.cgi?id=15734
> [4] https://www.w3.org/Bugs/Public/show_bug.cgi?id=15713
> [5] http://dev.w3.org/csswg/css-regions/#the-region-pseudo-element

I actually greatly preferred the @region syntax, because it was easier for writing several rulesets for how styles should change within a single region. I think it was also much more readable than having the selector chains inside a pseudo-element of another selector chain. 

I also thought @region was an improvement on the similar type of fragment child-element styling of @page. With @page, there are child rulesets only for margin boxes within the @page, and I always thought @page would benefit by being more like @region, allowing arbitrary selectors for anything appearing within that fragment. So, I am very disappointed to see the regions spec going away from the clear, easy to read and write syntax it had, instead of seeing other specs, like paged media, moving more towards the @region example. I'm not too familiar with ::distributed(), but it might have benefited from moving to an @distributed syntax instead too. 

Received on Tuesday, 14 May 2013 03:56:07 UTC