 Search
guides/style-guide: Style Guide guides/style-guide: ## Box Model guides/style-guide: ## Text plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers components/popover: Popover components/popover: ## Import components/popover: ## Usage components/popover: ### position- components/popover: #### Values components/popover: ### Properties components/popover: ### Extending plugins/plugin-nf: Nerd Font Plugin plugins/plugin-nf: ## Installation plugins/plugin-nf: ## Install a Nerd Font plugins/plugin-nf: ### Static Font plugins/plugin-nf: ### CDN plugins/plugin-nf: ## Components plugins/plugin-nf: ### <details> plugins/plugin-nf: ### Badge plugins/plugin-nf: #### cap- components/badge: Badge components/badge: ## Import components/badge: ## Usage components/badge: ### variant- components/badge: ### Properties components/badge: ### Extending components/badge: ## Scope components/input: Input components/input: ## Import components/input: ## Usage components/input: ### box- components/input: ### size- components/input: ### Extending components/input: ## Scope start/ascii-boxes: ASCII Boxes start/ascii-boxes: ## Usage start/ascii-boxes: ## Border Types start/ascii-boxes: ## Containment start/ascii-boxes: ## Custom Properties start/ascii-boxes: ### --box-border-color start/ascii-boxes: ### --box-rounded-radius start/ascii-boxes: ### --box-border-width start/ascii-boxes: ### --box-double-border-width plugins/theme-nord: Nord Theme plugins/theme-nord: ## Installation plugins/theme-nord: ## Components plugins/theme-nord: ### Typography plugins/theme-nord: ### Badge plugins/theme-nord: ### Button plugins/theme-nord: ## CSS Variables components/button: Button components/button: ## Import components/button: ## Usage components/button: ### box- components/button: ### variant- components/button: ### size- components/button: ### disabled components/button: ### Properties components/button: ### Extending components/button: ## Scope plugins/theme-catppuccin: Catppuccin Theme plugins/theme-catppuccin: ## Installation plugins/theme-catppuccin: ## Flavors plugins/theme-catppuccin: ## Components plugins/theme-catppuccin: ### Typography plugins/theme-catppuccin: ### Badge plugins/theme-catppuccin: ### Button plugins/theme-catppuccin: ## CSS Variables plugins/theme-gruvbox: Gruvbox Theme plugins/theme-gruvbox: ## Installation plugins/theme-gruvbox: ## Variants plugins/theme-gruvbox: ## Components plugins/theme-gruvbox: ### Typography plugins/theme-gruvbox: ### Badge plugins/theme-gruvbox: ### Button plugins/theme-gruvbox: ## CSS Variables components/typography: Typography components/typography: ## Import components/typography: ## Usage components/typography: ### <h1>-<h6> components/typography: ### <p> components/typography: ### <blockquote> components/typography: ### <ol> components/typography: ### <ul> components/typography: #### <ul> Markers components/typography: ### [is-="typography-block"] components/typography: ## Scope start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins start/intro: Introduction start/intro: ## Features start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells start/installation: Installation start/installation: ## Installation start/installation: ## ESM Imports start/installation: ## CDN Imports start/installation: ## Full Library Import

Gruvbox Theme

A port of the Gruvbox color palette to WebTUI.

Provides additional variants for the listed components in the base WebTUI library and supports both dark (default) and light themes with multiple contrast levels.

Installation

Install the theme with your preferred package manager

bun i @webtui/theme-gruvbox
npm i @webtui/theme-gruvbox
yarn add @webtui/theme-gruvbox
pnpm i @webtui/theme-gruvbox

Ensure you import the theme after all the other stylesheets from @webtui/css or the styles will not be applied.

@layer base, utils, components;

@import "@webtui/css/base.css";
@import "@webtui/css/components/typography.css";
/* ... */

@import "@webtui/theme-gruvbox";

Set the data-webtui-theme attribute on the <html> tag or a container element.

<html data-webtui-theme="gruvbox-dark-medium"></html>

To only apply the theme to a specific element:

<html data-webtui-theme="dark">
  <!-- Example base theme -->
  <body>
    <div data-webtui-theme="gruvbox-light-hard">
      <!-- Gruvbox light-hard styles applied here -->
    </div>
    <div data-webtui-theme="gruvbox-dark-soft">
      <!-- Gruvbox dark-soft styles applied here -->
    </div>
  </body>
</html>

Variants

Supports dark and light modes, each with hard, medium, and soft contrast levels.

<!-- Dark Variants -->
<html data-webtui-theme="gruvbox-dark-hard">
  <html data-webtui-theme="gruvbox-dark-medium">
    <!-- Default: gruvbox-dark or gruvbox -->
    <html data-webtui-theme="gruvbox-dark-soft">
      <!-- Light Variants -->
      <html data-webtui-theme="gruvbox-light-hard">
        <html data-webtui-theme="gruvbox-light-medium">
          <!-- Default: gruvbox-light -->
          <html data-webtui-theme="gruvbox-light-soft"></html>
        </html>
      </html>
    </html>
  </html>
</html>

Components

Components affected/modified by the theme:

Typography

  • Colors headings from h1 to h6 using var(--gb-green).
  • Inline <a> tags are underlined and colored var(--gb-blue), changing to var(--gb-aqua) on hover.
  • Inline <code> tags are colored var(--gb-orange).
<h1>Heading 1</h1>
<!-- ... -->
<h6>Heading 6</h6>

<p><a href="https://example.com">Link</a> <code>Inline Code</code></p>

Badge

Adds additional variants to badges matching Gruvbox accent colors.

<span is-="badge" variant-="gray">gray</span>
<span is-="badge" variant-="red">red</span>
<!-- ... -->
<span is-="badge" variant-="aqua">aqua</span>
<span is-="badge" variant-="orange">orange</span>

Button

Adds additional variants to buttons matching Gruvbox accent colors.

<button variant-="gray">gray</button>
<button variant-="red">red</button>
<!-- ... -->
<button variant-="aqua">aqua</button>
<button variant-="orange">orange</button>

CSS Variables

Adds the following CSS variables within the base layer.

Raw color tokens and base semantic variables (--background*, --foreground*) are defined within theme-specific variant blocks. Dark mode uses bright accents, Light mode uses standard/faded accents.

@layer base {
  /* Common Dark Variables & Semantic Mapping */
  [data-webtui-theme|="gruvbox-dark"] {
    /* ... raw dark vars ... */
    --gb-orange: #fe8019; /* Bright Orange */

    /* Semantic Mapping (Dark) */
    --background0: var(--gb-dark-bg0);
    --background1: var(--gb-dark-bg1);
    --background2: var(--gb-dark-bg2);
    --background3: var(--gb-dark-bg3);
    --foreground0: var(--gb-dark-fg1);
    --foreground1: var(--gb-dark-fg2);
    --foreground2: var(--gb-dark-fg3);
  }

  /* Dark Contrast Specific bg0 */
  [data-webtui-theme="gruvbox-dark-hard"] {
    --gb-dark-bg0: #1d2021;
  }
  [data-webtui-theme="gruvbox-dark-medium"] {
    --gb-dark-bg0: #282828;
  }
  [data-webtui-theme="gruvbox-dark-soft"] {
    --gb-dark-bg0: #32302f;
  }

  /* Common Light Variables & Semantic Mapping */
  [data-webtui-theme|="gruvbox-light"] {
    /* ... raw light vars ... */
    --gb-orange: #d65d0e; /* Standard/Faded Orange */

    /* Semantic Mapping (Light) */
    --background0: var(--gb-light-bg0);
    --background1: var(--gb-light-bg1);
    --background2: var(--gb-light-bg2);
    --background3: var(--gb-light-bg3);
    --foreground0: var(--gb-light-fg1);
    --foreground1: var(--gb-light-fg2);
    --foreground2: var(--gb-light-fg3);
  }

  /* Light Contrast Specific bg0 */
  [data-webtui-theme="gruvbox-light-hard"] {
    --gb-light-bg0: #f9f5d7;
  }
  [data-webtui-theme="gruvbox-light-medium"] {
    --gb-light-bg0: #fbf1c7;
  }
  [data-webtui-theme="gruvbox-light-soft"] {
    --gb-light-bg0: #f2e5bc;
  }
}

The base WebTUI background/foreground variables are mapped like this:

[data-webtui-theme|="gruvbox"] {
  /* Defaults to dark values */
  --background0: var(--gb-dark-bg0);
  --background1: var(--gb-dark-bg1);
  --background2: var(--gb-dark-bg2);
  --background3: var(--gb-dark-bg3);

  --foreground0: var(--gb-dark-fg1);
  --foreground1: var(--gb-dark-fg2);
  --foreground2: var(--gb-dark-fg3);

  /* Override for any light variant */
  [data-webtui-theme|="gruvbox-light"] & {
    --background0: var(--gb-light-bg0);
    --background1: var(--gb-light-bg1);
    --background2: var(--gb-light-bg2);
    --background3: var(--gb-light-bg3);

    --foreground0: var(--gb-light-fg1);
    --foreground1: var(--gb-light-fg2);
    --foreground2: var(--gb-light-fg3);
  }
}