[css syntax] CSS Syntax and Semantic Classes

CSS Working Group,


Greetings.  With regard to CSS, XML, HTML, EPUB3, style and semantics:




http://www.w3.org/TR/2013/REC-css-style-attr-20131107/

http://www.w3.org/TR/css3-syntax/

http://dev.w3.org/csswg/css-namespaces/

http://www.w3.org/TR/rdfa-core/

http://www.w3.org/TR/rdfa-core/#typing-resources-with-typeof

http://www.w3.org/TR/role-attribute/

http://www.idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-content-type-attribute 
(http://www.idpf.org/epub/vocab/structure/)
http://www.w3.org/TR/curie/

http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface

https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-document-getelementsbyclassname

http://css-tricks.com/the-extend-concept/









I would like to indicate the following syntax example:




<section xmlns:css="..." xmlns:ext="..." class="ext:x1 ext:x2 ..." style="css:x3=value1; css:x4=value2; ...">...</section>





By mapping existing CSS syntax ‘:’ operator to ‘=’, and ‘|’ to ‘:’, the @class and @style attributes’ values, as indicated above, could utilize XML namespaces in scope.  Beyond syntactic transformations, however, the classes in the indicated syntax are semantic.  The indicated syntax utilizes a whitespace-separated list of names, CURIE’s or IRI’s, for the @class attribute to facilitate semantics for XML formats and topical, then, would be @class, @xhtml:role, @rdfa:typeof and @epub:type .




In October of 1995, the version 4 draft of CSS 1.0 utilized the ‘=’ operator.  A month later, amidst discussions of the @style attribute, version 5 of that draft introduced the ‘:’ operator.


The HTML specification indicates that “authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content” (http://www.w3.org/html/wg/drafts/html/master/dom.html#classes).  For another point of view, see Defending Presentational Class Names (http://tympanus.net/codrops/2013/01/22/defending-presentational-class-names/) and CSS can presently cascade style based upon the attribute values of @xhtml:role, @rdfa:typeof and @epub:type .


With the indicated syntax, and by specifying default namespaces and/or how to compute default namespaces when processing documents’ @class and @style attributes, syntactic backwards compatibility can be achieved for XML languages which utilize CSS.  Each CSS property could map to a CSS XMLNS in a manner extensible and modular (see also: https://www.google.com/#q=%22xmlns:css%22+site:w3.org).










Kind regards,




Adam Sobieski

Received on Monday, 3 February 2014 15:54:38 UTC