Skip to content

feat(themes): adds tokens for glass and redhat themes#8062

Merged
mcoker merged 4 commits intopatternfly:mainfrom
srambach:8061-add-glass-tokens
Jan 27, 2026
Merged

feat(themes): adds tokens for glass and redhat themes#8062
mcoker merged 4 commits intopatternfly:mainfrom
srambach:8061-add-glass-tokens

Conversation

@srambach
Copy link
Copy Markdown
Member

@srambach srambach commented Jan 20, 2026

Fixes #8061

Adds token files for glass and redhat (unified) themes.

Note: The new tokens files are only the changed tokens compared to the default (existing patternfly theme) set of tokens.

Backstop report shows differences in

  • tree view (expected)
  • text/icon color on disabled backgrounds (looks like an update to --pf-t--global--color--disabled--300)

Summary by CodeRabbit

  • New Features
    • Added frosted "glass" theme and glass-dark variant.
    • Introduced Red Hat theme family: light, dark, high-contrast, and glass variants.
    • Expanded brand color families (accent & subtle) and corresponding interaction states.
    • Added loading-skeleton color tokens and new background/opacity and shadow/text-decoration adjustments for improved surface and loading visuals.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

Adds new theme token modules (glass and multiple Red Hat variants) and corresponding mixin-based token overrides; expands base and dark token sets with glass, loading-skeleton, and extended brand/accent/subtle tokens. New token files are imported and exposed via theme variants.

Changes

Cohort / File(s) Summary
Main configuration
src/patternfly/base/patternfly-variables.scss
Added eight @use imports for new token modules (tokens-glass, tokens-glass-dark, tokens-redhat, tokens-redhat-dark, tokens-redhat-highcontrast, tokens-redhat-highcontrast-dark, tokens-redhat-glass, tokens-redhat-glass-dark) and wired them into theme variants.
Base & Dark token surfaces
src/patternfly/base/tokens/tokens-default.scss, src/patternfly/base/tokens/tokens-dark.scss
Extended token families: added background shade 700, glass background/filter/opacity tokens, loading-skeleton colors, expanded brand accent/subtle token sets, adjusted border defaults and box-shadow Y values, and many new public mappings for on-brand/on-brand-subtle/accent contexts.
Glass theme variants
src/patternfly/base/tokens/tokens-glass.scss, src/patternfly/base/tokens/tokens-glass-dark.scss
Added @mixin pf-v6-tokens in each file providing glass-specific overrides (glass floating/primary RGBA, filter intensity, opacity) for light and dark glass variants.
Red Hat theme variants
src/patternfly/base/tokens/tokens-redhat.scss, src/patternfly/base/tokens/tokens-redhat-dark.scss
Added @mixin pf-v6-tokens files mapping Red Hat brand accent colors and radii to base/dark tokens (several token overrides referencing existing variables).
Red Hat high-contrast variants
src/patternfly/base/tokens/tokens-redhat-highcontrast.scss, src/patternfly/base/tokens/tokens-redhat-highcontrast-dark.scss
Added comprehensive pf-v6-tokens mixins remapping many border, color, text, icon, background, focus, and radius tokens to high-contrast values for light and dark modes.
Red Hat + Glass variants
src/patternfly/base/tokens/tokens-redhat-glass.scss, src/patternfly/base/tokens/tokens-redhat-glass-dark.scss
Added pf-v6-tokens mixins combining glass visuals with Red Hat brand overrides (glass background/filter/opacity plus brand accent and border mappings).

Sequence Diagram(s)

(omitted — changes are token additions and mixin mappings without multi-component runtime control flow)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title follows conventional commit guidelines with 'feat' type and descriptive scope '(themes)', clearly summarizing the main change of adding glass and redhat theme tokens.
Linked Issues check ✅ Passed The pull request successfully implements the objective from issue #8061 by adding token files for glass and redhat themes, extending CSS imports as required, and surfacing new theme tokens for consumption by the codebase.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding glass and redhat theme tokens and updating existing token files to support new themes. No extraneous changes are present outside the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@src/patternfly/base/patternfly-variables.scss`:
- Around line 8-14: Remove the trailing whitespace after the alias on the
existing import (the `@use "./tokens/tokens-redhat" as redhat` line) and add an
import for the missing glass dark tokens file by adding a `@use` for
`tokens-glass-dark` (alias it consistently, e.g., `glass-dark`) next to the
other token imports so the standalone non-redhat glass dark theme is available
alongside `tokens-glass` and `tokens-redhat-glass-dark`.

In `@src/patternfly/base/tokens/tokens-default.scss`:
- Line 115: The token --pf-t--global--text-decoration--offset--hover in
tokens-default.scss is unitless (5) and must be a valid CSS length; change its
value to the same pattern used in tokens-local.scss (for example:
calc(var(--pf-t--global--spacer--xs) + 1px)) so consumers like button.scss
receive a proper length and remain consistent with the default offset token and
normalize.scss usage.

In `@src/patternfly/base/tokens/tokens-redhat-highcontrast-dark.scss`:
- Line 5: Update the misleading header comment "// Only tokens that differ from
base theme (40 tokens)" to reflect the actual number of token definitions
present in src/patternfly/base/tokens/tokens-redhat-highcontrast-dark.scss
(currently 41), or fix the token-generation script so it emits the correct
count; locate the header comment in that SCSS file and either increment the
numeric value to 41 or adjust the generator logic that produces the count so the
comment matches the actual number of token definitions.

--pf-t--global--spacer--800: 5rem;
--pf-t--global--text-decoration--line--100: none;
--pf-t--global--text-decoration--line--200: underline;
--pf-t--global--text-decoration--offset--hover: 5;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

rg -n --type=scss "text-decoration--offset--hover" -C3

Repository: patternfly/patternfly

Length of output: 186


🏁 Script executed:

rg -n --type=scss "text-decoration--offset" -C2

Repository: patternfly/patternfly

Length of output: 93


🏁 Script executed:

rg -n --type=scss "text-decoration" -A2 -B2 | head -100

Repository: patternfly/patternfly

Length of output: 93


🏁 Script executed:

rg -n "text-decoration--offset--hover" -C3

Repository: patternfly/patternfly

Length of output: 3435


🏁 Script executed:

rg -n "text-decoration--offset" -C2

Repository: patternfly/patternfly

Length of output: 5108


🏁 Script executed:

# Check the file directly to see context around line 115
fd "tokens-default.scss" -x wc -l {}

Repository: patternfly/patternfly

Length of output: 117


🏁 Script executed:

# Read the relevant section of the file
fd "tokens-default.scss" -x cat -n {} | sed -n '110,130p'

Repository: patternfly/patternfly

Length of output: 1304


🏁 Script executed:

# Also check line 596 with default offset
fd "tokens-default.scss" -x cat -n {} | sed -n '590,605p'

Repository: patternfly/patternfly

Length of output: 1698


Fix unitless value for text-decoration offset hover token.

The --pf-t--global--text-decoration--offset--hover: 5; token is unitless and inconsistent with the default offset token (var(--pf-t--global--spacer--xs)) and the tokens-local override (calc(var(--pf-t--global--spacer--xs) + 1px)). Although the normalize.scss usage wraps it in max(var(...), 0.33em) providing a fallback, the bare 5 value is invalid when consumed directly in button.scss and other components. This should match the pattern used in tokens-local.scss with proper length units.

🤖 Prompt for AI Agents
In `@src/patternfly/base/tokens/tokens-default.scss` at line 115, The token
--pf-t--global--text-decoration--offset--hover in tokens-default.scss is
unitless (5) and must be a valid CSS length; change its value to the same
pattern used in tokens-local.scss (for example:
calc(var(--pf-t--global--spacer--xs) + 1px)) so consumers like button.scss
receive a proper length and remain consistent with the default offset token and
normalize.scss usage.

Copy link
Copy Markdown

@lboehling lboehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this all looks right to me! so easy to see the differences with the shortened list!

I did just add in a new token for global--background--color--floating & added "--primary" to the end of the current glass token ((but i likely added those in after you pulled these))

Copy link
Copy Markdown
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everyting LGTM. On the new glass token names, just some feedback. I think we should tweak them before trying to use them. Do we want to do that in this PR or as a follow up?

  --pf-t--global--background--color--glass--floating: rgba(255, 255, 255, 0.8000);
  --pf-t--global--background--color--glass--primary: rgba(255, 255, 255, 0.8000);
  --pf-t--global--background--filter--glass: 12.5;
  --pf-t--global--background--opacity--glass: 80;

Thoughts:

  1. Since the background colors have the opacity built in, --pf-t--global--background--opacity--glass won't do anything.
  2. --filter--glass: 12.5 - the token is named "filter" but the value is specific to the "blur" filter. This is fine, but to future proof it, I'd separate those concepts somehow so that we could add extra filters (like saturate() or contrast() or opacity()). It would also be great to get this as px in the token (12.5px)
  3. --opacity--glass: 80 - token looks good but would be great to get with % (80%).
  4. Would it make sense to have a unique opacity and/or blur for floating vs primary?

My suggestion:

  1. Make --pf-t--global--background--color--glass--floating and --pf-t--global--background--color--glass--primary "figma only" vars, so we won't import them.
  2. We will add --pf-t--global--background--color--glass--floating and --pf-t--global--background--color--glass--primary as local/custom vars, and we'll set the color/opacity in them. So both figma and core will use the same var name for the actual var that gets used as the glass background color value.
  3. For both the primary and floating background colors, add a new var in figma that holds just the color. This would be for core only, for us to combine with the opacity var to construct the color function. We can name them --pf-t--global--background--color--glass--floating--base or something (with --base at the end). Not sure if we have an existing naming pattern that would work there? The value can be an existing token, too, instead of an rgb(), if a token is more ideal there.
  4. Change --filter--glass to --filter--blur--glass. Then if we add a contrast() filter or something, we can use --filter--contrast--glass. Also add px to the value so it's 12.5px. I thought about using --blur--glass, but if we added an extra opacity filter, using --blur--glass as the filter name would imply we would add --opacity--glass for the opacity filter, but --opacity--glass is already in use, so we would have a name conflict.
  5. Add % to --opacity--glass so it's 80%

So the token export would look like

  // from figma
  --pf-t--global--background--color--glass--floating--base: var(--pf-t--color--white);
  --pf-t--global--background--color--glass--primary--base: var(--pf-t--color--white);
  --pf-t--global--background--filter--blur--glass: 12.5px;
  --pf-t--global--background--opacity--glass: 80%;

  // core custom/local styles
  --pf-t--global--background--color--glass--floating: color-mix(in srgb, var(-pf-t--global--background--color--glass--floating--base) var(--pf-t--global--background--opacity--glass), transparent);
  --pf-t--global--background--color--glass--primary: color-mix(in srgb, var(-pf-t--global--background--color--glass--primary--base) var(--pf-t--global--background--opacity--glass), transparent);

On 2 & 3 above, we could also do it like this:

  // from figma - same names as the figma only tokens
  --pf-t--global--background--color--glass--floating: var(--pf-t--color--white);
  --pf-t--global--background--color--glass--primary: var(--pf-t--color--white);

  // core custom/local styles
  --pf-t--global--background--color--glass--floating--default: color-mix(in srgb, var(-pf-t--global--background--color--glass--floating) var(--pf-t--global--background--opacity--glass), transparent);
  --pf-t--global--background--color--glass--primary--default: color-mix(in srgb, var(-pf-t--global--background--color--glass--primary) var(--pf-t--global--background--opacity--glass), transparent);

Copy link
Copy Markdown
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will follow up on the issues I brought up;.

@mcoker mcoker merged commit f3d1e89 into patternfly:main Jan 27, 2026
5 checks passed
@patternfly-build
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.35 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add glass/redhat (unified theme) tokens

4 participants