I want to be able to click a link in a passage, and change the CSS for the rest of my game/story.
Is this possible? Specifically, I want to change html background colour, h1, h2, etc. colour, and .enchantment-link/link-hover colours.
I'm guessing some javascript might do it?
Comments
eg. If your new set of styles had a CSS class name of forest then the related CSS selectors would look something like: ... basically you add html.classname followed by a space character to the start of each normal CSS selector you want to include in the set, where classname is replaced with the actual CSS class name you are using like forest has been used in the above example.
Only issue is any headings I have at the start of the passages (e.g. ##Heading) now don't show as headings - they literally show "##Heading".
You will need to supply more information like examples of the actual effected passages and CSS you are using if you want help with this issue.
Not a big issue as I can work round it, but seems like a bug.
1. First (main) passage contains the following header markup: 2. A header tagged passage, either with or without content.
The header markup does not get converted into a HTML header element (H1 -> Hx) if it is on the first line of a passage, and this parsing error occurs in both Harlowe 1.2.2 and the new Harlowe 2.0.0. I suggest you create a new issue on the Harlowe project website.
I also noticed in your example that you switched from using a link to change which CSS class was in effect to using passage tags, one thing to note with the passage tag method is that the styling changes only effect passage that have passage tags assigned to them.
https://dekay01.itch.io/sandman
If you don't then the developer may not know the bug exists which could mean that it won't get fixed.