TG TactileGlass CSS
Theming

Customize

Color modes live in one sheet: src/scss/base/_themes.scss. Light is the full palette on :root. Dark is a patch — only the tokens that change. Structural values (type, radii, blur) stay on light.

1. Global :root

:root {
  --tg-primary: #c084fc;
  --tg-primary-rgb: 192, 132, 252;
  --tg-body-bg: #c8c2d4;
  --spacing: 0.25rem;
  --radius-md: 12px;
  --font-sans: "Inter", system-ui, sans-serif;
  --tg-neu-shadow-drop: 8px 8px 16px #a6a6a6, -8px -8px 16px #e0e0e0;
  --tg-glass-blur: blur(24px);
}

Keep the matching *-rgb channel in sync. Light and dark palettes live in src/scss/base/_themes.scss. btn-dark uses --tg-dark (always a dark fill), not page ink.

2. Spacing scale

Double --spacing and p-4, gap-4, and g-4 all grow. Left is default; right is --spacing: 0.5rem.

Default

p-4 gap-4
p-4 gap-4

--spacing: 0.5rem

p-4 gap-4
p-4 gap-4

3. Scoped brand

.demo-aurora

badge-primary text-primary link
.demo-aurora {
  --tg-primary: #c084fc;
  --tg-primary-rgb: 192, 132, 252;
}

4. Radius and clay

Tight radii

--radius-md: 6px;
--radius-lg: 10px;

Warm clay

morph-neu-inset
--tg-body-bg: #d7c4b0;
--tg-neu-shadow-drop: 8px 8px 16px #b59d86,
  -8px -8px 16px #f3e6d6;

5. Nested themes

theme-dark island

Canvas, ink, and shadows flip even if the page is light.

theme-light island

Force the default palette inside a dark page.

CSS variables catalog

Public API is --tg-{name} from the light map in src/scss/base/_themes.scss, plus structural tokens in _tokens.scss. --clr-*, --glass-*, --hybrid-*, and --neu-shadow-* are aliases of those --tg-* values. Dark mode only patches ink, canvas, shadows, and glass/hybrid fills — pastels inherit from light.

Brand and semantic

TokenRole
--tg-primaryBrand fill, focus, btn-primary
--tg-primary-rgbRGB channels for tints
--tg-secondaryMuted accent / btn-secondary
--tg-secondary-rgbRGB channels
--tg-successSuccess accent
--tg-success-rgbRGB channels
--tg-infoInfo accent
--tg-info-rgbRGB channels
--tg-warningWarning accent
--tg-warning-rgbRGB channels
--tg-dangerDanger accent
--tg-danger-rgbRGB channels
--tg-darkAlways-dark fill for btn-dark
--tg-dark-rgbRGB channels

Named palette

TokenRole
--tg-blueNamed blue
--tg-indigoNamed indigo
--tg-purpleNamed purple
--tg-pinkNamed pink
--tg-redNamed red
--tg-orangeNamed orange
--tg-yellowNamed yellow
--tg-greenNamed green
--tg-tealNamed teal
--tg-cyanNamed cyan
--tg-grayMid gray
--tg-gray-darkDark gray alias in the map
--tg-gray-100 … --tg-gray-900Gray ramp

Body, ink, and links

TokenRole
--tg-body-colorPage ink (also --clr-dark)
--tg-body-color-rgbRGB channels
--tg-body-bgCanvas / neu fill
--tg-body-bg-rgbRGB channels
--tg-heading-colorHeading ink
--tg-code-colorInline code ink
--tg-link-colorlink-primary color
--tg-link-color-rgbRGB channels
--tg-link-decorationLink underline
--tg-link-hover-colorLink hover
--tg-link-hover-color-rgbRGB channels
--tg-emphasis-colorStrongest ink
--tg-emphasis-color-rgbRGB channels
--tg-secondary-colorMuted copy / text-muted
--tg-secondary-color-rgbRGB channels
--tg-secondary-bgMuted surface
--tg-secondary-bg-rgbRGB channels
--tg-tertiary-colorQuiet copy
--tg-tertiary-color-rgbRGB channels
--tg-tertiary-bgQuiet surface
--tg-tertiary-bg-rgbRGB channels
--tg-highlight-bgMark / highlight fill
--tg-highlight-colorHighlight ink

Emphasis, subtle fills, and subtle borders

TokenRole
--tg-primary-text-emphasisStronger brand ink
--tg-secondary-text-emphasis --tg-success-text-emphasis --tg-info-text-emphasis --tg-warning-text-emphasis --tg-danger-text-emphasis --tg-light-text-emphasis --tg-dark-text-emphasisSemantic emphasis ink
--tg-primary-bg-subtleTinted brand surface
--tg-secondary-bg-subtle --tg-success-bg-subtle --tg-info-bg-subtle --tg-warning-bg-subtle --tg-danger-bg-subtle --tg-light-bg-subtle --tg-dark-bg-subtleSemantic subtle fills
--tg-primary-border-subtleTinted brand edge
--tg-secondary-border-subtle --tg-success-border-subtle --tg-info-border-subtle --tg-warning-border-subtle --tg-danger-border-subtle --tg-light-border-subtle --tg-dark-border-subtleSemantic subtle borders

Glass, hybrid, and neu

TokenRole
--tg-glass-bgDefault glass fill
--tg-glass-bg-raisedRaised glass / surface
--tg-glass-bg-pressedPressed glass
--tg-glass-blurFrost amount, e.g. blur(20px) — used by tg-glass / tg-glass-frosted
--tg-glass-menu-blurStronger blur for select menus (default blur(28px))
--tg-glass-menu-bgDenser translucent fill for nested select menus
--tg-glass-borderGlass edge
--tg-glass-shadowOuter drop + inset highlight stack
--tg-glass-rippleClick ripple on glass/hybrid buttons
--tg-hybrid-bgHybrid fill on neu shadows
--tg-hybrid-bg-pressedPressed hybrid
--tg-neu-shadow-dropRaised clay (5px 5px 13px family)
--tg-neu-shadow-insetSunken clay
--tg-neu-shadow-liftDeeper raised clay / interactive lift

Border, radius, shadow, and focus

TokenRole
--tg-border-width --tg-border-styleDefault border drawing
--tg-border-color --tg-border-color-translucentDefault edges
--tg-border-subtle --tg-hr-color --tg-code-bgDividers and code chips
--tg-border-radius --tg-border-radius-sm --tg-border-radius-lg --tg-border-radius-xl --tg-border-radius-xxl --tg-border-radius-2xl --tg-border-radius-pillTheme radius aliases
--radius-sm --radius-md --radius-lg --radius-squircle --radius-pillStructural radii used by components
--tg-box-shadow --tg-box-shadow-sm --tg-box-shadow-lg --tg-box-shadow-insetGeneric shadows
--tg-focus-ring-width --tg-focus-ring-opacity --tg-focus-ring-color --tg-focus-ring-blurFocus ring
--tg-form-valid-color --tg-form-valid-border-colorValid field
--tg-form-invalid-color --tg-form-invalid-border-colorInvalid field

Type, spacing, and breakpoints

TokenRole
--tg-body-font-family --tg-body-font-size --tg-body-font-weight --tg-body-line-heightBody type
--tg-font-sans-serif --tg-font-monospace --tg-gradientFamily aliases and optional gradient
--font-sans --font-display --font-serif --font-monoStructural families
--font-weight-normal --font-weight-medium --font-weight-boldWeights
--fs-xs … --fs-6xlType scale
--line-height-tight --line-height-relaxed --line-height-looseLeading
--letter-spacing-tight --letter-spacing-relaxed --letter-spacing-loose --letter-spacing-wideTracking
--spacingDrives p-*, m-*, gap-*, g-*
--sz-1 … --sz-12Named spacing steps
--max-w-xs … --max-w-2xl --max-w-proseMeasure
--ease --duration --focus-offsetMotion and focus offset
--z-base --z-sticky --z-overlayStacking
--tg-breakpoint-sm --tg-breakpoint-md --tg-breakpoint-lg --tg-breakpoint-xl --tg-breakpoint-xxl576 / 768 / 992 / 1200 / 1400

Sass

Compile from the package entry. Partials are loaded with @use in a fixed order from tactileglass.scss.

@use 'tactileglass-css/src/scss/tactileglass.scss';

Override tokens after import with CSS variables (preferred), or fork theme maps in base/_themes.scss and recompile:

  • $tg-theme-light / $tg-theme-dark — color modes
  • $tg-colors — semantic utility / component palette
  • $tg-breakpoints + tg-infix — responsive utility generation

There is no Bootstrap-style $enable-* option map yet; carve unused layers by forking the entry @use list if you need a smaller sheet.

Optimize

  • Ship dist/tactileglass.min.css in production (npm run build).
  • Purge unused selectors with your bundler / Lightning CSS / PurgeCSS — class names are static Bootstrap-style strings.
  • Prefer CSS variable overrides over duplicating component CSS.
  • Optional: compile a custom entry that drops unused component partials (alerts, pagination, …) if your app never uses them.