OK, here’s my updated attempt to standardize a basic set of CSS properties, removing the <variable-generic-family> list, and just standardizing on built-in generic font families.
In this implementation, AsyncGlk would have to parse the family list, look for monospace, and do post-processing in order to handle it.
Supported properties and values
Any Glk library that supports CSS Basic would have to support these properties and values. (Glk libraries may support other properties/values, but these would be guaranteed.) glk_css_supports would return 1 for all of these cases.
color /* <color> | <named-color> */
background-color /* <color> | <named-color> */
-iftf-reverse-video /* reverse | none */
font-weight /* normal | bold | 400 | 700 */ /* 400 = normal, 700 = bold */
font-style /* normal | italic | oblique */
font-size /* small | medium | large | larger | smaller | <%> | <length> (positive only) */
font-family /* <family-names> */
text-decoration /* none | underline */
text-decoration-line /* none | underline */ /* alias */
EDIT: Previously I went with --glk-reverse: 0|1 but changed it after discussion in Should we standardize a pseudo-CSS property for "reverse video"?
The following properties have no effect on glk_css_inline_set(), but would affect paragraphs with glk_css_hint_set():
text-align /* left | right | center | justify */
margin-left /* <length> */
margin-right /* <length> */
text-indent /* <length> */
Value types
| Type | Grammar / examples | Notes |
|---|---|---|
<color> |
#rgb, #rrggbb, #rrggbbaa |
Browsers support lots of other ways of specifying colors: rgb(), hsl(), etc. but Basic only requires these. Transparency support is required; #00000000 should be transparent, not opaque black. |
<named-color> |
transparent, black, white, red, green, blue, cyan, magenta, yellow, gray/grey, silver, maroon, olive, lime, aqua, teal, navy, purple, fuchsia, orange, pink |
CSS supports hundreds of named colors, but Basic only requires these. |
<length> |
12px, -12px, 12pt, 2em, 0px, 0 |
Basic only requires support for px, pt, and em units, plus unitless 0. Browsers support dozens of other units of length. |
<%> |
0%, 100%, 50% |
|
<generic-family> |
serif, sans-serif, monospace |
Browsers support other generic families, but Basic only requires support for these. |
<family-names> |
'OCR A extended', "Courier New", Courier, monospace |
Comma-separated list of family names, including <generic-family> names. Quotes required for names with spaces. |
Whitespace around values is insignificant. All property names and Basic values are case insensitive.