 Search
components/badge: Badge components/button: Button components/checkbox: Checkbox components/dialog: Dialog components/input: Input components/popover: Popover components/pre: Pre components/radio: Radio components/separator: Separator components/switch: Switch components/table: Table components/textarea: Textarea components/tooltip: Tooltip components/typography: Typography plugins/plugin-nf: Nerd Font Plugin plugins/theme-catppuccin: Catppuccin Theme plugins/theme-gruvbox: Gruvbox Theme plugins/theme-nord: Nord Theme start/changelog: Changelog start/ascii-boxes: ASCII Boxes start/intro: Introduction start/intro: ## Features start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins contributing/contributing: Contributing contributing/contributing: ## Local Development contributing/contributing: ## Issues contributing/contributing: ## Pull Requests contributing/style-guide: Style Guide contributing/style-guide: ## CSS Units contributing/style-guide: ## Selectors contributing/style-guide: ## Documentation plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells installation/nextjs: Next.js installation/vite: Vite start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/installation: Installation start/installation: ## Installation start/installation: ## Using CSS start/installation: ## Using ESM start/installation: ## Using a CDN start/installation: ## Full Library Import start/installation: ### CSS start/installation: ### ESM start/installation: ### CDN installation/astro: Astro installation/astro: ## Scoping installation/astro: ### Frontmatter Imports installation/astro: ### <style> tag installation/astro: ### Full Library Import

Theming

Theming can be done by editing the CSS variables in the base stylesheet, or if you install a theme plugin

CSS Variables

@webtui/css ships with a set of CSS variables that control font styles and background/foreground colors

These can be customized with the CSS :root selector on the base layer

@layer base {
    :root {
        --font-size: 18px;
        --font-family: "JetBrainsMono", monospace;
    }
}

Font Styles

@layer base {
    :root {
        --font-size: 16px;
        --line-height: 1.3;
        /* Font weight for bold text */
        --font-weight-bold: 700;
        /* Font weight for regular text */
        --font-weight-normal: 400;
        --font-family: monospace;
    }
}

Colors

The base theme consists of four background levels and three foreground levels

Additional color accents/variants can be added to components individually with CSS or by importing a theme plugin

@layer base {
    :root {
        /* Default background color */
        --background0: #fff;
        /* Background levels 1-3 */
        --background1: #ddd;
        --background2: #bbb;
        --background3: #999;

        /* Default foreground color */
        --foreground0: #000;        
        /* Foreground levels 1-2 */
        --foreground1: #444;
        --foreground2: #888;
    }
}

Shown below is a screenshot showing the background and foreground colors of a basic light theme, dark theme, Nord, and Catppuccin

theme-pallettes.png

Light & Dark

@webtui/css ships with a basic light and dark theme

To enable the dark theme, simply add data-webtui-theme="dark" to the <html> tag, or any element that should inherit the theme colors

<html data-webtui-theme="dark">

Theme Plugins

Theme plugins change the base colors and often include additional color variants and styles for individual components

catppuccin-badges.png

Check out the Plugins page for a list of available themes