Adding color to your content will make it more meaningful and you can bring more feelings to your text.
Custom style map #
Custom style map is an object that help you to create your desired styles and assign a key to
that. There is an
initialStyleMap map provided by
Contenido. It's a better practice to spread
the initial value in your final style map to use the built-in styles.
Toggle color #
To toggle the text font or background color, you can use
to create your custom utility for your prefered colors.
This function help you to find out if the current character has your style or not. The returend boolean will update on cursor moves.
In this example, the font and backgound color of the text can be toggled with the