W3C home > Mailing lists > Public > www-style@w3.org > May 2011

Re: [Selectors4] Semantic Pseudo Elements

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Tue, 10 May 2011 19:11:36 +0200
Message-Id: <E824AFB3-2164-4206-B7CE-6A1D254FD950@crissov.de>
To: W3C style mailing list <www-style@w3.org>
Tab Atkins Jr.:
> On Tue, May 10, 2011 at 5:02 AM, Christoph Päper
>> Eduard Pascual:
>>> On Mon, May 9, 2011 at 7:44 PM, Christoph Päper <christoph.paeper@crissov.de> wrote:
>>>> 2. To support lean, non-verbose markup (e.g. Markdown, e-mail and wiki syntaxes).
>>> Nothing prevents CSS from working on other markup.
>> Maybe, but selectors are ugly then, even for paired markers: …
>> Some markers may be ambiguous, because they can be used paired inline or line-initial: …
>> Inline plain text pseudo stylings are also not always applied in a start-tag / close-tag manner: …
> Ah, you're somewhat confused here.

No, I’m not, but maybe I’m not making my point clear enough. The examples were intended to show that the concept of element name is not easily applied to some markup languages. Since element names are the most prominent type of selector you would need some other mechanism.

Btw., to get this straight, Eduard Pascal is an alter ego of Tab Atkins Jr. (or vice versa)?

> (I'll assume for the moment that the language in your examples is Markdown.)

Some of it is.

> It would indeed be inconvenient for authors if Markdown created nodes in its element-tree with tagnames that need to be escaped.

I suggested semantic pseudo elements or classes to avoid inventing new names for every language out there.

> since it maps to HTML,

This is but one mapping.

> it might be convenient to just give the same tagnames as the HTML equivalents.

So, you think matching

  /a text like this/


  em {foo: bar}


  i {foo: bar}

is better than

  :emphasis {foo: bar;}?

I beg to differ.

>>  ::keyword {color: blue}
> keyword { color: blue; }

Yes, that could work, although it it probably works worse with namespaces.

> It's even easier to just use "em" or "emphasis" rather than ":emphasis".

But ‘em’ (and possibly ‘emphasis’ too) is an element name in and therefore selector for at least one other markup language. It is much cleaner to provide a generic mechanism.

>> How would the selector for ‘[[Foo]]’ or ‘{Bar}’ look like?
> … a parser could make an element named "link" or "a" or whatever.

‘:link’ already exists.

>  I dunno what "{Bar}" is, but it would do
> something similar.
Received on Tuesday, 10 May 2011 17:12:31 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:45 UTC