Theming
Ricos is stylable, which means you can apply color schemes & font properties to your Ricos UI.
The theming API provides an ability to customize the style of your plugins, toolbars, and content with ease and consistency.
#
ColorsThe color mechanics of Ricos manifest in almost every element that's displayed.
The structure here is based on 3 color properties (aka Palette
):
- Text Color
- Action Color
- Background Color
Check this Theme Playground to understand the influence of each color on plugins, toolbars and modals.
You can also modify colors of specific elements (like text headers / links). See Custom Styles API below.
#
Palettenote
bgColor
will not set a background-color
for Ricos' content by default.
Please read the contentBgColor
under PaletteConfig section below.
Palette can receive few more optional fields:
fallbackColor
#
When ActionColor
is too bright, it is replaced with FallbackColor
when used on bright backgrounds (e.g modals, toolbars).
Therefore this color should remain relatively dark.
Default is black.
textColorLow
#
Work in progress
disabledColor
#
Work in progress
#
Palette PresetsPick a palette preset by name. Currently supports 'darkTheme' only.
#
PaletteConfigcontentBgColor
#
If set to true, Ricos' internal content container would be colored with bgColor
.
Ricos' background color is transparent by default.
The recommended practice of changing the background is to wrap Ricos with your own container, set with your own background.
However, in case you want to change the content background, you should pass contentBgColor: true
Default value: false
.
settingsActionColor
#
Override the actionColor
of floating panels & settings modals.
Default is actionColor
.
note
Only applicable for RicosEditor
focusActionColor
#
Override the actionColor
of plugin when focused / clicked
Default is actionColor
.
note
Only applicable for RicosEditor
#
Custom StylesRicos allows you to customize several font and color properties of the content.
The font-family
of a text content within Ricos is inherited from that component's wrapper, while other typography properties like font-size
are defined within Ricos. These properties can be overridden via customStyles
:
See here RicosCustomStyles type declaration
This is Header 2
This is Header 3
This is a quote
This is Header 2
This is Header 3
This is a quote
#
APIh1, h2, h3, h4, h5, h6, p, link, hashtag:
#
quote:
#
button:
#
footerToolbar:
#
mention:
#
codeBlock:
#
editor:
#
#
Settings StylesThe editor panels' styles can be modified according to your choice.
#
parentClassIf you plan to apply different palettes to multiple instances of Ricos, which would be living next to each other (like on this page, for example), you will need to specify parentClass
. Otherwise, you can safely ignore it.
parentClass
should refer to a parent's CSS className
that contains your Ricos instance. With it defined, dynamic styles will be wrapped under ".parentClass", which will increase CSS specificity.