Howdy, Stranger!

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

A really simple question regarding links and colors in Harlowe

As the title suggests, I'm having difficulty with what seems to be a fairly simple matter.

What I'm trying to do is fairly straightforward; I would like to color-code my passage links to differentiate their purpose. Orange to link to passages providing further explanation or extraneous asides, blue for stuff that actually matters, and red as a basic organizational tool for myself while writing to indicate that I need to elaborate on related passages.

However, it seems that (text color: "orange")[] only works for plain text, and not links. I assume there's something different I need to be doing, but looking through the documentation a few times hasn't helped yet.

...I feel like I ought elaborate more on my problem, but that's really pretty much it. Basically just, "Help, I can't make the color change code work!".

Comments

  • Try adding the following CSS to your Story Stylesheet:
    tw-hook[style*="color:"] tw-link, tw-hook[style*="color:"] .enchantment-link {
    	color: inherit;
    }
    
    ... it should allow you to use a (text color:) macro to set the colour of your markup and macro based links like the following examples:
    (textcolor: "orange")[[[Next Passage]]]
    
    (textcolor: "orange")[(link: "Next Passage")[(goto: "Next Passage")]]
    
    (textcolor: "orange")[|clickbased>[Next Passage](click: ?clickbased)[(goto: "Next Passage")]]
    
    (textcolor: "orange")[|namedhook>[[[Next Passage]]]]
    
  • Ah, thank you ^^ ! I'd glanced at the example selectors for the stylesheet in the wiki earlier, but everything they described seemed to have a more global effect, and I really don't know the first thing about CSS...

    This bit of code you provided is exactly what I was looking for. Thank you again ^^ !
  • greyelf wrote: »
    ... it should allow you to use a (text color:) macro to set the colour of your markup and macro based links like the following examples:
    (textcolor: "orange")[[[Next Passage]]]
    
    (textcolor: "orange")[(link: "Next Passage")[(goto: "Next Passage")]]
    
    (textcolor: "orange")[|clickbased>[Next Passage](click: ?clickbased)[(goto: "Next Passage")]]
    
    (textcolor: "orange")[|namedhook>[[[Next Passage]]]]
    

    This looks like just what I need for a project I'm working on. Strangely, I'm able to make it work for every example except for the clickbased one (third down), which defaults back to the color specified in the stylesheet. Screenshot attached. Any suggestions?

  • Your example image shows the third link as Yellow, as this is not one of Harlowe's default link colours (two shades of Blue and two shades of Purple) I will assume you are using custom CSS to change one or more of the default colours.

    Without an example of your custom CSS I can only guess that you have a CSS selector that is more precise than the one in my original comment, therefor it is overriding the colour.
  • That was it, yes. Thanks very much for your help.
Sign In or Register to comment.