W3C home > Mailing lists > Public > www-style@w3.org > April 2013

Re: [css4-pseudo] The need for more powerful pseudo elements

From: Tom Wardrop <tom@tomwardrop.com>
Date: Mon, 29 Apr 2013 11:11:01 +1000
Message-ID: <CAOvmfajUJQF-xhffA9GLiR54hsYdNEw1OuMyVRo6ZkaHGjj9RQ@mail.gmail.com>
To: François REMY <francois.remy.dev@outlook.com>
Cc: "Sam L'ecuyer" <sam@cateches.is>, "www-style@w3.org" <www-style@w3.org>
I'm not really following your decorator concept François. Can you link me
to something that gives a better definition?

Tom


On Mon, Apr 29, 2013 at 6:34 AM, François REMY <
francois.remy.dev@outlook.com> wrote:

> > From: sam@cateches.is
> >
> > I disagree. Although it's ripe for abuse (like most things), this was
> > discussed in last week's thread "[css4-pseudo] multiple and
> > nested pseudo-element ordering"
>
> To be honest, I had a flag on this mail as a potential reply-to subject ^_^
>
>
> > The use case for me, though, was that I had a large amount of metadata
> > in data-attributes on an element and wanted to display tags after the
> > content (newspaper headlines are the context).
>
> Yes, this is a *much* better use case, without any doubt. But, still, you
> can solve it using only one after pseudo-element and decorators:
>
>   [data-content-access="premium"]::after {
>     decorator[premium]: premium-decorator;
>   }
>
>   [data-content-type="video"]::after {
>     decorator[video]: video-decorator;
>   }
>
>   [data-content-subtype="porn"]::after {
>     decorator[video]: porn-video-decorator;
>   }
>
> with premium decorator, video-decorator & porn-video-decorator being small
> markups that will represent your shadow DOM elements.
>
> The advantage of decorators is that they are way more powerful than
> generated content.
>
>
> > That way, I can create a series of ::after()s, each with its own
> > (small) tree based on metadata. This is especially helpful when some
> > of the metadata is generated via javascript after the page loads. We
> > don't want to create and append nodes, we'd just like to be able to say
> > .setAttribute("data-content-type","blog") and have the rest take care
> > of itself.
>
> It's not really the role of CSS to handle markup, if you want my opinion.
> But this advantage is preserved by the decorator solution, anyway, it's
> just the way get defined that is changed.
>
> I'm really concerned that with CSS-defined markup, we risk to let authors
> morph the layout DOM tree in subtle ways that could be really hard to debug.
>
>
> _______________________
>
> Disclaimer: I'm not a member of the CSS Working Group so don't take
> everything I say for a W3C opinion. I'm neither able nor mandated to
> represent this group's opinion ;-)
Received on Monday, 29 April 2013 01:11:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 April 2013 01:11:36 UTC