Howdy, Stranger!

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

When using the (click:replace) macro in Harlowe, how do I change the color of the resulting hook?

First, to give you a better idea of what I'm currently dealing with, here is the passage text that I'm using (in Twine 2.0, Harlowe):

You glance at the time and see that it's 6:00 AM. (click-replace:"6:00 AM")[8:00 AM](click-replace:"8:00 AM")[7:17 AM](click-replace:"7:17 AM")[3:71 AM](click-replace:"3:71 AM")[1:00 PM](click-replace:"1:00 PM")[6:00 AM]

The macro works perfectly but the clickable text is this horrid shade of blue and I can't figure out how to change it. I've already tried using this inside the hooks themselves:

<span style="color:#e619e5;"></span>

So that it looked like this:

(click-replace:"6:00 AM")[<span style="color:#e619e5;">8:00 AM</span>]

Unfortunately this doesn't seem to work with the (click-replace) macro at all. Anyway, I'm very, very new to twine so I might be missing something obvious, but I can use all the help I can get. Thanks in advance!

Comments

  • As explained in this comment the colour of Harlowe links (in your case a (click-replace:) link) are hard wired, and the solution needed to get around this issue can be different for each use-case.

    In your particular use-case you have at least two solutions:

    1. Use a span to uniquely identify the first plan text 6:00 AM and use CSS to colour the link:
    You glance at the time and see that it's <span id="time">6:00 AM</span>.  ...snip...
    
    #time .enchantment-link {
    	color: #e619e5;
    }
    
    2. Wrap the first plan text 6:00 AM in a (text-color:) macro and use CSS to force the link to use the colour specified in the macro.
    You glance at the time and see that it's (text-color: "#e619e5")[6:00 AM].  ...snip...
    
    tw-hook[style*="color"] .enchantment-link {
    	color: inherit;
    }
    
    warning: Although the second solution looks like the better one, the related CSS is less precise so it may cause side effects in other places in your story, then again it may not. Which solution you use is up to you.
  • edited February 2016
    Thank you so much! I used the first solution and it worked beautifully!

Sign In or Register to comment.