A couple of suggestions regarding applying specific styling to content:
1: The return from styling Changers can be stored in a variable.
(set: _shadowy to (b4r: "inset", "outset", "outset", "inset") + (b4r-size: 3.9, 5.7, 5.7, 3.9) + (b4r-colour: white, grey, grey, white))
Storing changers in a variable can be useful when the same styling needs to be applied multiple times within a Passage…
Blah blah
_shadowy[content with a shadow box]
More blah blah
_shadowy[more content with a shadow box]
2: A Named Hook can be targeted by a CSS Rule defined in a project’s Story Stylesheet area.
eg. A Named Hook like the following…
|shadowy>[content with a shadow box]
…generates the following HTML when that Passage is visited…
<tw-hook name="shadowy">content with a shadow box</tw-hook>
…which means a CSS Rule like the following that targets any <tw-hook> element that has a name attribute of "shadowy" can be used to apply the same styling as the Changers mentioned in point 1…
tw-hook[name="shadowy"] {
border-style: inset outset outset inset;
border-width: 3.9px 5.7px 5.7px 3.9px;
border-color: rgb(255, 255, 255) rgb(136, 136, 136) rgb(136, 136, 136) rgb(255, 255, 255);
display: inline-block;
}
The above CSS Rule allows Passage content like the following to be written…
Blah blah
|shadowy>[content with a shadow box]
More blah blah
|shadowy>[more content with a shadow box]
notes:
- The variable assignment example in point 1 is using a Temporary variable, because storing such Changes within a variable requires more space that storing a Number or a short String. Thus if a Story variable is used then that additional storage space is added to Progress History, which can affect the amount of storage a Save needs.
- The CSS property assignments used in point 2 were obtained by using the web-browser’s Web Developer Tools to inspect the HTML generated by your (@AdNauseam) original shadow border example.
- Personally I finds using Named Hooks combined with related CSS Rules a better way to apply styling to a page than Harlowe’s own styling macros, because it generally results in less messy Passage content.