0 votes
asked by (2k points)

This evening has been full of wonders...

Does anybody knows how to double use custom styles ?
I'd love to do something like : 

 

@@#Processing; color:red; Processing...@@

 

So that what's in "#Processing" would be "Processing..." written in red ! 
But so far, I didn't manage to...

Thanks a lot for your help.

And have a good evening.

2 Answers

+1 vote
answered by (54.3k points)
selected by
 
Best answer

That should work.  You do not, generally, add spaces though.  For example: 

@@#Processing;color:red;Processing...@@

commented by (2k points)
Damn, you're right once again. The space was causing the issue.
Thanks a lot !
0 votes
answered by (52.5k points)
If you mean what I think you do, just move your style rules to your story Stylesheet.

For example (the toolbar isn't displaying for me, so I can't use the code tags):

#processing {
    color : red;
}

Then, in passage:

@@#processing;Processing...@@

Any text or element given the '#processing' id will now be red. Note that if you want multiple elements in the same passage to have red text, you'll need to use a class, which is prefixed by a dot rather than a hash:

.processing {} in css

@@.processing;@@ in passage
commented by (2k points)

That's interesting as well, I had no idea you could do that. 
But then, is it possible to change the content of the story stylesheet from within the story ? I was aiming to do something of that kind : 

 @@#Connect; color:red;Connecting...@@

<<timed 2s>>

        <<replace '#Connect'>>

@@color:green;Connected !@@ 

         <</replace>> 

<</timed>>


<<timed 4s>>

              <<remove '#Connect'>>

<</timed>>
 

commented by (52.5k points)
Well, what you should probably do is define classes for your styles then add and remove those as needed, rather than creating another span inside the original span just to change the text color.

That said, what you're doing works, to its probably not a big deal.

Anyway, I think I just misread the question, so ignore me if TME got you the answer you were looking for.
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.
...