Re: [css syntax] CSS Syntax and Semantic Classes

On 6 February 2014 16:08, Adam <adamsobieski@hotmail.com> wrote:
> CSS Working Group,
>
> The topics of semantic styling become more interesting with expansions of
> XML, e.g. web components.  Web components and styling web components are
> relatively new topics.  Web component authors, e.g. CMS widgets, might want
> to make use of the expressiveness of @xhtml:role, @rdf:type, @rdfa:typeof or
> @epub:type and possibly with semantic aspects of @class.  Semantic styling
> could also be of use for such scenarios.

You can use @namespace to style namespaced elements (including
applying styles to non-HTML documents that are properly namespaced).
This can be extended to apply styling to semantics-orientated
attributes. For example:

/* (X)HTML @role */
*[role=banner] { ... }

/* RDFa @property */
*[property="dc:creator"] { ... }

/* ePub @epub:type */
@namespace epub url(http://www.idpf.org/2007/ops);
nav[epub|type=page-list] { display: none; }

The limitation here is that the content of the attributes must be
exact string matches. That is, they do not match on expanded CURIE
values (e.g. using dc11:creator instead of dc:creator).

-----

PROPOSAL: Add selector support for matching expanded namespace form.

The best you could hope for here is to have a selector that matches an
item in a CURIE list, where the expanded namespace name is compared,
not the literal string. For example:

@namespace dc11 url(http://purl.org/dc/elements/1.1/);
*[property=dc11|creator] { ... }

NOTE: The form of the selector is not necessarily what it will end up
as, this is just outlining the functionality of the selector.

This would then match:

    <html xmlns:dc11="http://purl.org/dc/elements/1.1/">
    <div property="dc11:creator">Jane Bloggs</div>

    <!-- different namespace prefix -->
    <html xmlns:dc="http://purl.org/dc/elements/1.1/">
    <div property="dc:creator">Jane Bloggs</div>

    <!-- namespace defined in @prefix with a different prefix -->
    <html prefix="dc: http://purl.org/dc/elements/1.1/">
    <div property="dc:creator">Jane Bloggs</div>

Thanks,
- Reece H. Dunn

Received on Thursday, 6 February 2014 19:40:00 UTC