-
Notifications
You must be signed in to change notification settings - Fork 779
Description
In the 2003 WD of CSS Content, it was anticipated that the string-set property would take as its value a list of pairs of custom ident and source:
The 'string-set' property accepts values similar to the 'content' property, including the extraction of the current value of counters.
META[author] { string-set: author attr(author); } HEAD > TITLE { string-set: title contents; }
All subsequently released drafts of that module, including the current ED, limited the capability of this property in prose. It is supposed to effectively always store the equivalent of content() or content(text):
The
string-setproperty copies the text content of an element into a named string, …
However, its syntax requires at least one <string> after the initial custom identifier in order to select what should be stored in the named string:
Value:
none | [ <custom-ident> <string>+ ]#
Accordingly, some of the following examples contain functions that return a <string>:
h2 { string-set: heading content() }
h1 { string-set: header content(before) ':' content(text); }
section { string-set: header attr(title) }
However, the very first example contains the keyword contents in place of a <string>:
H1 { string-set: chapter contents; }
This keyword is specified in section 2.3 of the same module as part of the <content-list> type, which is strongly tailored to the content property.
<content-list> = [ <string> | <image> | <attr()> | contents | <quote> | <leader()> | <target> | <string()> | <content()> | <counter> ]+
In conclusion, please clarify the default and valid values of the string-set property, which might look like one of these:
none | <custom-ident>– suggested by current prosenone | <custom-ident>#– also consistent with current prosenone | [ <custom-ident> <string>* ]#– compromise between current syntax and prosenone | [ <custom-ident> <string>+ ]#– current syntaxnone | [ <custom-ident> <content-list>+ ]#– suggested by examplesnone | [ <custom-ident> [ <string> | <counter> | <attr()> | <content()>]* ]#– covers all examples except the first which would be changed to usecontent()instead, also includes all types available in the fallback "/ alt" value of thecontentproperty