Continuing the discussion from Ordered lists with non-number markers:
Quotes from other thread for context.
What I’m asking in this thread is: is there any way to add custom CSS that is also applied to the editor preview?
Adding CSS to the editor preview
The discussion revolves around adding custom CSS to the editor preview in Discourse. FroggyC initially asks how to apply CSS to the editor preview, specifically for a custom list style. They reference a previous discussion where Falco provided a solution for adding custom CSS to lists.
FroggyC tried the solution but couldn’t get it to work in the editor preview. However, they eventually found a solution by using the .d-editor-preview CSS class as a selector FroggyC.
Falco confirms that this is the correct solution, as it extends the CSS to apply to both the post stream and the preview area. FroggyC thanks Falco for the confirmation.
Finally, FroggyC asks how to differently style more deeply nested layers of lists, wondering if an additional nested level of ol would be required.
Continuing the discussion from Ordered lists with non-number markers:
Quotes from other thread for context.
What I’m asking in this thread is: is there any way to add custom CSS that is also applied to the editor preview?
I figured it out on my own. The solution is to use the .d-editor-preview CSS class as a selector.
.cooked, .d-editor-preview {
div[data-wrap="letterlist"] {
ul, ol {
list-style-type: upper-alpha;
}
}
}
That’s the way. The previous was specific to the post as it’s show in the stream, you extended it to also apply in the preview area, so that’s the correct solution indeed.
Thank you, Falco.
@Falco , if I wanted to differently style the more deeply nested layers of lists, would that be an additional nested level of ol?