To answer your question: no, you can’t easily change passage tags in Harlowe. It isn’t designed for that functionality.
What you are asking about isn’t impossible, but it is probably more complicated than you expected. Let’s look at some examples of how to approach this.
(1) Working with (enchant:)
In Harlowe 2, there is a hook called ?Passage
that can be used with the macro (enchant:)
to affect the content of a passage.
Using the tags, day
and night
, then, the macro (passage:)
can be used as part of a header
passage (which will be run before any current passage) to test for these.
:: StoryTitle
Harlowe Tags
:: Start[day]
Day
[[Night Example]]
:: Night Example[night]
Night
:: Header[header]
{
(if: (passage: )'s tags contains "day")[
(enchant: ?Passage, (background: yellow) )
]
(if: (passage: )'s tags contains "night")[
(enchant: ?Passage, (background: grey) )
]
}
(The above example is written in Twee.)
The background color of the content of each passage would then change based on if the current passage had the tag day
or night
. (Using the keyword contains
also opens up the ability to use other tags, or even test for them and change other things.)
(2) Working with (enchant:)
and (css:)
In Harlowe 2, the hook ?Page
should be able to be used on the whole page to change its appearance. However, this has some issues because of how different elements use CSS internally. Instead, a combination of ?Passage
and the use of the (css:)
macro can be used to override the base CSS.
{
(if: (passage: )'s tags contains "day")[
(enchant: ?Passage, (css: "background-color: yellow; position: absolute; top: 0; left: 0; height: 100%; width: 100%; padding: 2em;") )
]
(if: (passage: )'s tags contains "night")[
(enchant: ?Passage, (css: "background-color: grey; position: absolute; top: 0; left: 0; height: 100%; width: 100%; padding: 2em;") )
]
}
This solution is more extreme than the first because it effectively visually overwrites the sidebar and makes the ‘passage’ the same size as the story itself. However, it can be used to make a cleaner visual change between the ‘day’ and ‘night’ cycle you asked about.