Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Changing link colour for indivisual passages.

I'm currently writing a segment where light is fading. If the player keeps choosing to push on (as opposed to camping until daylight returns) I darken the text on each subsequent passage so that it becomes difficult to read.

I'm doing this with a simple <span style> in the passage itself, but can't work out how to do the same with the links, too.

Comments

  • You need to state which story format you are using, as answers can be different for each one.

    You could possibly use either static or dynamic passage tags to control the CSS (text and links) that gets applied to a set of passages (thus removing the need for a span element).
    How you do this depends on the story format.
  • edited November 2015
    Sorry, Sugarcube (online version). Man you must get fed up of typing that line :D

    I was thinking of an overall page opacity, but wouldn't know how to do it for individual passages.

    [Edit] I can't quite believe this, but I managed to work it out just from your line about passage tags! I added the tag 'fadinglight' to the passage, and then to the CSS I added .fadinglight {opacity: 0.5}

    Thank you a lot.
  • Jud_Casper wrote: »
    Sorry, Sugarcube (online version). Man you must get fed up of typing that line :D
    Sometimes. *smile*
    Jud_Casper wrote: »
    [Edit] I can't quite believe this, but I managed to work it out just from your line about passage tags! I added the tag 'fadinglight' to the passage, and then to the CSS I added .fadinglight {opacity: 0.5}
    well done, did you find the Tagged Stylesheet Warning section of SugarCube's excellent documentation?
  • edited December 2015
    greyelf wrote: »
    ... did you find the Tagged Stylesheet Warning section of SugarCube's excellent documentation?
    No, but I shall go and have a read right now.

    Oh, I see. It's just confirming that what I did was correct. My success was just one of those rare flukes, helped with a little CSS coding knowledge.

    What does this mean from that document?
    Multiple Stylesheet Warning

    It is strongly recommended that you use only a single stylesheet tagged passage. CSS styles cascade in order of load, so if you use multiple stylesheet tagged passages, then it is all too easy for your styles to be loaded in the wrong order, since Twine gives you no control over the order in which multiple stylesheet tagged passages load.
    Am I doing wrong by adding my style changes to the CSS? This sounds like it's saying I should create a passage with the tag 'stylesheet' and add my changes there?
  • Jud_Casper wrote: »
    What does this mean from that document?
    Multiple Stylesheet Warning

    It is strongly recommended that you use only a single stylesheet tagged passage. CSS styles cascade in order of load, so if you use multiple stylesheet tagged passages, then it is all too easy for your styles to be loaded in the wrong order, since Twine gives you no control over the order in which multiple stylesheet tagged passages load.
    Am I doing wrong by adding my style changes to the CSS? This sounds like it's saying I should create a passage with the tag 'stylesheet' and add my changes there?
    No. That's a hold-over from when the documentation was only for Twine 1 (in which stylesheets were simply passages tagged with stylesheet). The Twine 2 model only allows a single stylesheet already (via Edit Story Stylesheet).

    I seem to have failed to upload some of the updates I made to the SugarCube v1.x documentation when I started publishing releases for both versions of Twine. Mea culpa, I'll get that fixed up.
Sign In or Register to comment.