Skip to content

CSS Variables

Unstable

Theming support works but is still rough around the edges. If you run into issues, you can achieve similar results through the plugin API's injectCSS method or through Kagi's own custom CSS setting while the theming engine is being stabilized.

Kagi uses CSS custom properties extensively, and overriding these variables is the primary way Corgi themes change the page appearance.

All variables are set on :root and cascade through the entire page. Corgi applies overrides with !important to ensure they take priority over Kagi's defaults.

Core

VariableDefault (dark)Description
--app-bg#1a1a2ePage background
--app-text#e0e0e0Default text color
--app-frame-bg#121225Frame/card backgrounds
--color-schemedarkBrowser color scheme hint

Typography

VariableDefaultDescription
--font-mainSystem stackPrimary font family
--font-lufgaLufgaHeading font
--font-monoMonospace stackCode and monospaced text

Colors

VariableDescription
--primaryPrimary accent color
--primary-hoverPrimary color on hover
--primary-25 through --primary-900Primary color scale
--secondarySecondary accent
--linkLink text color
VariableDescription
--color-search-inputSearch input text color
--color-search-input-borderSearch input border
--search-result-titleSearch result title color

UI Elements

VariableDescription
--input-bgInput field background
--modal-bgModal overlay background
--hover-bgHover state background
--inline-widget-bgWidget card background
--box-shadowDefault box shadow
--border-colorBorder color (not always defined by Kagi, used by Corgi)

Buttons

VariableDescription
--btn-primary-bgPrimary button background (defaults to var(--primary))
--btn-primary-colorPrimary button text (defaults to var(--secondary))
--primary-hoverPrimary color on hover state

Kagi buttons use the .btn class with modifier classes: .btn.--primary for a solid background (--btn-primary-bg), .btn.--secondary for outlined (border: 1px solid --btn-primary-bg), .btn.--gray for a subtle background (--inline-widget-bg), .btn.--link for a link-colored background, and .btn.--danger for red (--red-800).

All .btn elements use border-radius: 999px (pill shape) by default.

Search Input

VariableDescription
--color-search-inputSearch input background color (defaults to var(--input-bg))
--color-search-input-borderSearch input border color
--box-shadowBox shadow used on search input container

Reading Variables

To read the current computed value of a variable from a plugin:

typescript
const bg = api.getComputedVariable('--app-bg');

This returns the resolved value after all theme overrides are applied.

Not affiliated with Kagi Inc.