+3 votes
by (940 points)
So I wanted to have a unique look for every character in my story, but being illiterate in css I'm having a hard time finding a way to switch my style mid story every time the character changes.


Is it possible? Or Should I simply try to swap images "faking" a new style?

1 Answer

+1 vote
by (63.1k points)
selected by
Best answer

You can use passage tags to add classes to your body that can be controlled via CSS. If you need to do it dynamically, you can use the <<addclass>> and <<removeclass>> macros. 

More info here and here

by (940 points)
Oh I see. Yeah it turns out it wasn't anything incredible, but my poor knowledge of CSS makes everything complicated.


On a more practical approach I essentially tag the passages that I want with the name of the class and then describe said class in the stylshhet, right?
by (157k points)
The first reference link supplied by @Chapel includes multiple examples showing how to implement the "body" element based CSS selectors for a passage tagged with "forest" (without quotes), just replace that tag-name with your own class-name.
by (940 points)
Yes, I read that, I just wanted to ask to be sure. Thank you.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.