[css3-gcpm] Content templates

Alexander Shpack:

> Main goal: more flexible content constructor, based on HTML templates

The ‘content’ property is, despite its name, still only to be used for style, not content. HTML and other document languages have to deal with macros themselves (e.g. local entity references in SGML and XML).

I agree, though, that the Web languages, i.e. HTML+CSS, are not as feature-rich as, say, TeX in this regard, unless preprocessed or scripted.

> content: pattern(#id);

Selectors in values are always a bad idea.

See GCPM or Content for an alternate proposal that seems to come close to what you desire.
<http://dev.w3.org/csswg/css3-gcpm/#named-strings>
<http://dev.w3.org/csswg/css3-content/#strings>

> <div><span id="contentPattern">This is </span>madness!</div>
> <div id="content">SPARTA!</div>
> 
> #content {content: pattern(contentPattern);}

Since the ‘content’ property replaces default content with its value, the second line would read:

  This is 

With ‘string-set’ the CSS for your example would look something like this:

  #contentPattern {string-set: pattern contents;}
  #content        {content: string(pattern) contents;}

Received on Thursday, 15 March 2012 11:23:02 UTC