diff --git a/.changeset/docs-css-variables-font-sizes.md b/.changeset/docs-css-variables-font-sizes.md new file mode 100644 index 000000000..a38f75adc --- /dev/null +++ b/.changeset/docs-css-variables-font-sizes.md @@ -0,0 +1,5 @@ +--- +"@tabler/docs": patch +--- + +Updated documentation to explain font sizing and system color CSS variables (`--tblr-primary-rgb`, `--tblr-secondary`, `--tblr-tertiary`, `--tblr-link-color`, `--tblr-gray-*`). diff --git a/docs/content/ui/getting-started/customize.md b/docs/content/ui/getting-started/customize.md index c670b719c..337a777c1 100644 --- a/docs/content/ui/getting-started/customize.md +++ b/docs/content/ui/getting-started/customize.md @@ -27,6 +27,35 @@ Now you just need to tell Tabler to use your favorite font: ``` +## Custom font sizes + +Tabler exposes typography settings as CSS variables. You can override them by setting variables on `:root` (global) or on any container (scoped). + +### Base font size + +To change the default font size used by body text and many components, override `--tblr-body-font-size`: + +```html + +``` + +### Headings + +Headings use `--tblr-font-size-h1` … `--tblr-font-size-h6` and `--tblr-line-height-h1` … `--tblr-line-height-h6`: + +```html + +``` + ## Custom primary color To change the primary color of Tabler you need to set the `--tblr-primary` variable in your CSS. You can use any color format you like (hex, rgb, hsl, etc). In this example we will use a custom red color: @@ -34,7 +63,56 @@ To change the primary color of Tabler you need to set the `--tblr-primary` varia ```html -``` \ No newline at end of file +``` + +If you use `--tblr-primary` in `rgba()` contexts (or see inconsistent colors), also override `--tblr-primary-rgb` (as comma-separated RGB values) and optionally `--tblr-primary-fg` (text/icon color used on primary backgrounds): + +```html + +``` + +## Other system colors + +Tabler also exposes a few "system" colors you can customize globally: + +```html + +``` + +### Gray scale + +You can override the full gray palette (`--tblr-gray-50` … `--tblr-gray-950`) to match your brand: + +```html + +```