Member-only story

CSS for Roam (3rd lesson): Advanced selectors for #tags and [[pages]]

Cato Minor
9 min readOct 12, 2020
The irresistible power of Roam, image based on unDraw.co .

Welcome to the third article on the CSS in Roam. Previously, we have covered:

This time, I would like to expand on the power of #tags and [[pages]] and show how they can affect other elements. Before, however, we must prepare ourselves: First, a little recapitulation of basic simple selectors in CSS, then we will learn about the so-called combinators that allow us to create complex selectors, finally, we will look at the code of Roam and what it allows us to do. With this knowledge, we will create our custom highlighting colors in Roam.

A little recapitulation — Simple selectors

We have already seen that we can select an element by its name, by its class, and by its attribute. I have also mentioned that we can select an element based on its ID even though we haven’t seen any example yet. We can visualize these options as follow:

It is also perfectly fine to combine these and create so-called compound selectors. You can find the whole overview on selectors on W3schools web…

--

--

Cato Minor
Cato Minor

Responses (3)