- From: Sylvain Galineau <galineau@adobe.com>
- Date: Wed, 15 May 2013 15:55:42 -0700
- To: Brad Kemper <brad.kemper@gmail.com>, Alan Stearns <stearns@adobe.com>
- CC: "www-style@w3.org" <www-style@w3.org>
On 5/15/13 12:08 PM, "Brad Kemper" <brad.kemper@gmail.com> wrote: > >On May 15, 2013, at 10:30 AM, Alan Stearns <stearns@adobe.com> wrote: > >> On 5/14/13 4:09 PM, "Brad Kemper" <brad.kemper@gmail.com> wrote: >> >>> On May 14, 2013, at 10:52 AM, Alan Stearns <stearns@adobe.com> wrote: >>> >>>> On 5/13/13 8:55 PM, "Brad Kemper" <brad.kemper@gmail.com> wrote: >>>> >>>>> 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 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 agree that the @region syntax was more compact for some cases. I >>>>think >>>> it's arguable that separating the content selectors from the box >>>> selector >>>> made it more readable. >>> >>> Not to my mind. If it is a longish selector to select the region, and >>> another longish selector to select the proper elements to change within >>> that region, then one must write a very long selector with the >>> pseudo-element approach, all on one line. And then one must write the >>> first part again and again for each separate rule one wants to apply >>> unique styling to within the region. It doesn't follow DRY principles. >>> Whereas with the @rule, ones selects the region once, and then has >>> simpler, shorter selectors for each ruleset being selected within the >>> region. A little indenting within the style sheet, and one can clearly >>> see which selectors are children of the region selector. >> >> This is a problem with longish selectors outside of region styling (as >> François mentioned[1]). I think the proper fix > >At least you do admit, then, that it is harder to read, and needs some >sort of fix that the @region version didn't. I think the point is that such selectors are hard to read everywhere the pattern happens, not just when styling Regions. As such a more general selector syntax solution to this kind of nesting pattern may be more helpful than adding more at-rules?
Received on Wednesday, 15 May 2013 22:56:08 UTC