Skip to content

Conversation

triplingual
Copy link
Contributor

Closes #45

@stephenwf
Copy link
Contributor

@triplingual I've added basic support for this in Theseus:
https://theseusviewer.org/?iiif-content=https%3A%2F%2Fpreview.iiif.io%2Fcookbook%2F0045-css%2Frecipe%2F0045-css%2Fmanifest.json&panel=annotations

I think it would be worth recommending implementations use CORS for the stylesheet if they want to improve its chances of working in generic viewers (in order to potentially sanitise or extract the styles).

@triplingual
Copy link
Contributor Author

Thank you for the implementation. That's a good idea about CORS.

@glenrobson
Copy link
Member

Comments from the cookbook authors:

The title is CSS in an Annotation Body but now we have css in the body and target this should be renamed. (Glen suggestion: Styling Annotations with CSS? maybe)

Use case

Could you do the use case from with the use of 'you' e.g:

You have two different authors… You would like to distinguish the authors.

To match the style of other use cases.

Implementation notes

"Using CSS to alter resource presentation styles is not specified in the IIIF Presentation 3.0 API except insofar as the Presentation API incorporates types from the W3C Web Annotation Data Model."

Could you reword as something like:

Using CSS in annotations is covered in the W3C Web Annotation Data Model

This is due to some annotation stuff being covered in the spec but not CSS.

With the second paragraph on inline, with an inline stylesheet, or with an external stylesheets the editors found this confusing and wondered if it could be re-written to focus first on the method you are using in the example (external stylesheet) and then at the end briefly mention the other options and link to the recipes. Possibly by moving the "see Image Rotation Two Ways (inline stylesheet) and Visible Text Resource on a Canvas (inline CSS)." from the example up to this paragraph.

Example

  • Remove Python: iiif-prezi3
  • Although thesesus doesn’t show the viewer it would be good to include it as partial support with a note in the example mentioning the target isn't working.

OK to go to the TRC with changes.

1. Changed a lot of text to address editor comment about confusing implementation notes. It was a good comment, and these changes prune significant superfluous text around the other ways of using CSS in a manifest. 2. Moved text pointing to other recipes from Example to Implementation Notes to sub for the previous unnecessary discussion of other CSS use methods. 3. Changed highlighting in targets to only highlight the styleClass, since the recipe is about CSS, not targets. 4. Moved from Implementation Notes to Restrictions the pointer to HTML in Annotations for the discussion of markup limitations. Also added to that pointer text the reason it matters.
tags: [style]
summary: "Using an external CSS stylesheet in an annotation body, annotations can be styled in limited ways"
viewers:
- Theseus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be:

  • id: Theseus
    support: partial

As it doesn't support the target styling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target styling is supported now on Theseus, but there is a CORS issue when loading the style.css file at the moment. https://theseusviewer.org/?iiif-content=https%3A%2F%2Fpreview.iiif.io%2Fcookbook%2F0045-css%2Frecipe%2F0045-css%2Fmanifest.json


{% include manifest_links.html manifest="manifest.json" %}

{% include jsonviewer.html src="manifest.json" config='data-line="56,60,71,78,82,93"' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be:

"56,60,72,79,83,95"

As the highlighting is slightly off

Comment on lines +92 to +96
"target": {
"type": "SpecificResource",
"source": "{{ id.path }}/canvas/p1#xywh=170,160,2200,1000",
"styleClass": "author2"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the source can itself be a specific resource.

I think this would be more expected for a "SpecificResource" class:

"target": {
  "type": "SpecificResource",
  "source": "https://preview.iiif.io/cookbook/0045-css/recipe/0045-css/canvas/p1",
  "styleClass": "author2",
  "selector": {"type": "FragmentSelector", "value": "xywh=170,160,2200,1000"}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS styling
3 participants