Override Designsystemet CSS tokens for color, typography, and spacing.
Call inside your UI alongside use_designsystemet().
Arguments
- color
Global color context. One of
"default","brand1","brand2","neutral","success","warning","danger","info". Setsdata-coloron<html>.- font_size
Base font size as a CSS value (e.g.
"16px","1rem"). Overrides--ds-font-size-baseon:root.- border_radius
Border radius as a CSS value (e.g.
"4px","0"). Overrides--ds-border-radius-mdon:root.Padding for buttons as a CSS shorthand (e.g.
"0.4rem 0.9rem"). Overrides--dsc-button-paddingon:root.- ...
Named CSS custom property overrides in the form
"--ds-token-name" = "value". Applied to:root.
Details
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.
Examples
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")
)