Skip to content

Add the string-set property and string()/content() content functions - #215

Merged
TylerBrinks merged 1 commit into
TylerBrinks:masterfrom
jhaygood86:feature/gcpm-string-set
Jul 23, 2026
Merged

Add the string-set property and string()/content() content functions#215
TylerBrinks merged 1 commit into
TylerBrinks:masterfrom
jhaygood86:feature/gcpm-string-set

Conversation

@jhaygood86

Copy link
Copy Markdown
Contributor

Feature

The string-set property and the string() / content() functions (CSS GCPM §7):

h1 { string-set: chapter content(); }
@page { @top-center { content: string(chapter); } }
p::before { content: content(before); }

Implementation

  • StringSetProperty with a StringSetValueConverter parsing [ <custom-ident> <content-list> ]# | none, where a content-list item is a <string>, counter()/counters(), content(), string(), or attr().
  • ContentFunctionConvertercontent() / content(text|before|after|first-letter) (default text).
  • StringFunctionConverterstring(name) with an optional first/last/start/first-except keyword (default first).

Both functions are also accepted inside the content property.

Tests

24 cases in PropertyTests/StringSetPropertyTests.cs: string-set with each content-list item type, multi-pair lists, none, malformed values (name with no list, list with no name, bad mode); and string()/content() inside content, with their keyword forms and rejections.

The full suite (1263 existing tests) stays green, and all seven target frameworks build with no new warnings.

GCPM's string-set property and the string()/content() functions had no
support. Add StringSetProperty with a StringSetValueConverter parsing
"[ <custom-ident> <content-list> ]# | none" (content-list items being a
<string>, counter()/counters(), content(), string() or attr()), plus
ContentFunctionConverter (content()/content(text|before|after|
first-letter)) and StringFunctionConverter (string(name) with an
optional first/last/start/first-except keyword). Both functions are also
accepted inside the content property.
@jhaygood86
jhaygood86 marked this pull request as ready for review July 22, 2026 23:30
@TylerBrinks
TylerBrinks merged commit 0e7eca0 into TylerBrinks:master Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants