Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested / Compounded roles: apply multiple roles to overlapping text

In my custom.css file I have,

.bold {
    font-weight: bold;
}

.red {
    color:red;
}

And in my _.rst file,

.. role:: bold

.. role:: red

But if I try to nest/compound them, only the outermost role takes effect, e.g.


:bold:`:red:`This is only bold``

This is only bold


Is there a way to combine these effects without defining a new (combined) role?

like image 912
DilithiumMatrix Avatar asked Apr 01 '17 21:04

DilithiumMatrix


1 Answers

you can use a custom css class directive:

.. cssclass:: boldred

  bold red text

and update the css to format the boldred class

like image 165
Mark Hoeber Avatar answered Nov 07 '22 12:11

Mark Hoeber