+1 vote
asked by (180 points)

I have a game where the colors change for different tags. Here is the CSS:

tw-story[tags="great"] {
    background: white;
        color: black;
}


tw-story[tags="good"] {
    background: #b2b2b2;
      color: black;
}
tw-story[tags="ok"] {
    background: silver;
        color: black;
}

How do I change the link color inside the tags?

1 Answer

+2 votes
answered by (55.6k points)
selected by
 
Best answer

The selectors for links in Harlowe are tw-link for markup links and link macros, and .enchanent-link for click-related macros. Additionally, links change colors on hover using the css :hover pseudoclass and upon returning to a passage after already having been visited with the .visited class. To change the color, you'll probably want to change all of these, so your selectors might look like this: 

tw-story[tags="great"] tw-link, tw-story[tags="great"] .enchantment-link {
    color: red; 
}

tw-story[tags="great"] tw-link:hover, tw-story[tags="great"] .enchantment-link:hover {
    color: pink; 
}
tw-story[tags="great"] .visited {
    color: violet; 
}

This will make all links, regardless of how they're generated, red and pink on hover. Visited links will be violet and pink on hover. 

commented by (180 points)
Thank you for your answer!
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...