View source: R/ds-dependencies.R
| ds_theme | R Documentation |
Override Designsystemet CSS tokens for color, typography, and spacing.
Call inside your UI alongside use_designsystemet().
ds_theme(
color = NULL,
font_size = NULL,
border_radius = NULL,
button_padding = NULL,
...
)
color |
Global color context. One of |
font_size |
Base font size as a CSS value (e.g. |
border_radius |
Border radius as a CSS value (e.g. |
button_padding |
Padding for buttons as a CSS shorthand
(e.g. |
... |
Named CSS custom property overrides in the form
|
Color palette tokens follow the Designsystemet naming convention. Use
data-color="brand2" on a container to switch its color context, or set
color here to change the global default.
A <style> tag applied to :root and optionally a JS snippet to
set data-color on <html>.
ui <- bslib::page_fluid(
use_designsystemet(),
ds_theme(color = "brand1", border_radius = "2px", button_padding = "0.3rem 0.8rem"),
ds_button("Click me", inputId = "btn")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.