Skip to content

Commit f61a0e2

Browse files
author
Rob Sanderson
committed
styleClass/stylesheet
1 parent e3b15aa commit f61a0e2

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

source/presentation/4.0/model.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,14 +2488,41 @@ The value _MUST_ be an array of JSON objects. Each item _MUST_ have the `id` and
24882488
### styleClass
24892489
{: #styleClass}
24902490

2491-
The name of a CSS class to apply when rendering the Specific Resource it is associated with.
2491+
The name of a CSS class to apply when rendering the Specific Resource the style class is associated with. This might change the color of the text, the background color, add borders to the element, change the font size or family, or any other CSS-based styling. The class definition is given using the `stylesheet` property, defined below, which can be used on an Annotation. While Specific Resources _MAY_ appear outside of Annotations, `styleClass` is not valid in these circumstances as there will not be a corresponding `stylesheet` to define the style. If the stylesheet does not define the class given in `styleClass`, then the class _MUST_ be ignored.
24922492

2493-
FIXME: Get rid of styles completely???
2493+
The value of the `styleClass` _MUST_ be a string.
2494+
2495+
For more information about `styleClass`, see the [Web Annotation Data Model](https://www.w3.org/TR/annotation-model/#styles).
2496+
2497+
* A Specific Resource _MAY_ have the `styleClass` property.<br/>
2498+
Clients _SHOULD_ process the `styleClass` property.
2499+
2500+
{% include api/code_header.html %}
2501+
``` json-doc
2502+
{ "styleClass": "red" }
2503+
```
24942504

24952505
### stylesheet
24962506
{: #stylesheet}
24972507

2498-
FIXME: Delete???
2508+
The `stylesheet` property conveys either a reference to an external CSS stylesheet document, or carries an embedded stylesheet. This stylesheet is used to resolve CSS classes for processing the `styleClass` directive on Specific Resources, described above.
2509+
2510+
The value for `stylesheet` _MUST_ be a JSON object. If the stylesheet is referenced, then the JSON object _MUST_ have the `id` and `type` properties. Conversely, if the stylesheet's content is embedded, then it _MUST_ have the `type` and `value` properties, and _MUST NOT_ have the `id` property. The value of `type` _MUST_ be "CssStylesheet".
2511+
2512+
For more information about `stylesheet`, see the [Web Annotation Data Model](https://www.w3.org/TR/annotation-model/#styles).
2513+
2514+
* An Annotation _MAY_ have the `stylesheet` property.<br/>
2515+
Clients _SHOULD_ process the `stylesheet` property on Annotations.
2516+
2517+
{% include api/code_header.html %}
2518+
``` json-doc
2519+
{ "stylesheet":
2520+
{
2521+
"type": "CssStylesheet",
2522+
"value": ".red { color: red }"
2523+
}
2524+
}
2525+
```
24992526

25002527

25012528
### summary

0 commit comments

Comments
 (0)