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.

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

Copy link
Contributor Author

@triplingual triplingual Nov 7, 2025

Choose a reason for hiding this comment

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

The notions of full or partial support are a little weird for this recipe. Since it now includes significant cautions to manifest publishers around uncertainty of CSS in viewers, support would seem to me to be "permitting some degree of styling using an external stylesheet." On the one hand, we can't insist that allowing all CSS is the only definition of full support*, but on the other we don't define what CSS should be supported they way we do with HTML. I'm inclined to invent a definition of full support for this recipe that is less about what you can do with CSS in a particular viewer and more about whether the viewer has help documentation about what CSS is permitted and forbidden in the viewer.

* Not that anyone is insisting that; saying this to draw one boundary.

Setting a bg color for the highlight obscured the image underneath. CSS is clunky because I'm not using multiple classes per note/highlight. It's not clear whether that's even possible, and in any case it would make the manifest less readable to use the cascade and have more compact CSS
@glenrobson glenrobson added the meta: ready-to-merge Pull request is ready to merge into main branch label Nov 14, 2025
@glenrobson glenrobson merged commit eb5a900 into master Nov 21, 2025
1 check passed
@glenrobson glenrobson deleted the 0045-css branch November 21, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

annotations content: image meta: ready-for-editors Ready for Cookbook editor review meta: ready-to-merge Pull request is ready to merge into main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS styling

4 participants