+1 vote
by (160 points)
This is probably a stupid question, but I have the variable $shipname and I want it to be italicized every time it pops up. I'm a CSS newbie so not really sure how to format that.

1 Answer

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

Not really a CSS question.

This is one of the rare cases of basic formatting where SugarCube's formatting markup doesn't have a direct analog.  The easiest thing would be to simply use the HTML italics markup (<i>…</i>) around the story variable when printing it.  For example:

The <i>$shipname</i> is your ship?!


If you're never going do anything with $shipname other than print it, then you could add the markup to the stored name.  For example:

→ Instead of something like this
<<set $shipname to "Millennium Falcon">>

→ Do this instead
<<set $shipname to "<i>Millennium Falcon</i>">>

You'd print it as normal:

The $shipname is your ship?!


If you will, or may, be using it for other purposes, then a widget may be a good option.  For example: (goes in a separate widget-tagged passage)

<<widget "shipname">><i>$shipname</i><</widget>>

To use it, you'd simply invoke the widget in place of printing the story variable:

The <<shipname>> is your ship?!


by (160 points)
That did it, thanks.