+1 vote
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
by (63.1k 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. 

by (180 points)
Thank you for your answer!
...