ysabetwordsmith: (zero)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote in [community profile] reddit_refugees2023-12-28 08:33 pm

How to Make a Graybar for Spoilers in Dreamwidth

One way to hide spoilers for people who don't want them, while presenting content notes for those who do want them, is to use a graybar. This makes the text and background the same color (except for links, so watch out for those). To read the text, just highlight it and the words will pop out.


Put this code at the beginning of the intended graybar text:
~span style="COLOR: rgb(102,102,102); BACKGROUND-COLOR: rgb(102,102,102)"~

Put this code at the end of the intended graybar text:
~/span~

To activate the code, replace the ~ with angle brackets. The angle brackets tell Dreamwidth that you are speaking to it in code and it should do something. So you can't print them without it activating, you have to replace them with something else or use spaces.

For reference, span style means do something nonstandard to the text. COLOR means the text color and BACKGROUND-COLOR means what is behind it. That rgb code is for gray. The / means "stop doing this" when used in code inside angle brackets.

You can also make a spoiler tag that works in comments.

And that's about the extent of my coding skill.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting