Skip to content

docs(theming): Adds details around new theme and glass mode.#4983

Merged
andrew-ronaldson merged 40 commits into
patternfly:mainfrom
edonehoo:iss4952
May 21, 2026
Merged

docs(theming): Adds details around new theme and glass mode.#4983
andrew-ronaldson merged 40 commits into
patternfly:mainfrom
edonehoo:iss4952

Conversation

@edonehoo
Copy link
Copy Markdown
Collaborator

@edonehoo edonehoo commented Mar 31, 2026

Makes progress on #4952 and #4951

updated https://pf-org--pr-4983-site.surge.sh/foundations-and-styles/theming
and added https://pf-org--pr-4983-site.surge.sh/foundations-and-styles/theming/glass-mode-handbook

Both of which will need Dev/Design input and validation. Will probably want some images to support the /theming docs (assume these can't be created until the tokens and kit updates are available):

  • Standard page Default theme (can create now)
  • Standard page Felt theme
  • Before/after glass image
  • Figma screenshot for swapping themes
  • theme switcher/theme preferences menu example - what do we want to suggest here?

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Mar 31, 2026

Preview: https://pf-org--pr-4983-site.surge.sh


### Swapping contrast modes

To swap your components to our high contrast mode, change the Semantic Dimension Tokens variable mode to be "High Contrast" and choose either "Light - High Contrast" or "Dark - High Contrast" for the Semantic Color Tokens variable mode:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

will want to update this to include glass

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

also to include the default vs felt theme toggle!

glass has some weirdness where users will have to switch the the "glass" or "plain" style variant of certain components in addition to setting the appearance toggles in order to get the glass mode to appear properly in figma.

@phcox
Copy link
Copy Markdown

phcox commented Apr 3, 2026

Just a couple of comments here on the glass mode handbook. Parts of this Opacity section seem to be at odds with the Glass design tokens table below it.

Opacity
The default opacity values used in our components have been tested for accessibility, legibility, and visual appeal.

Felt light typically utilizes a 40% opacity to maintain AAA contrast for standard text.
Felt dark utilizes a 60% opacity to provide better reliability for the dark color scheme.

Given that a variety of opacity percentages are shown in the table, this seems confusing to cite specific ones for each mode. Also, instead of "reliability" did you intend "readability"?

If a product team chooses to override these token values, they are responsible for conducting their own accessibility evaluation to ensure WCAG compliance.

I would not use "token values" in the above sentence, since you only referred to base opacity levels and not the tokens themselves.

I'm not well-versed in the actual values and tokens tha we've eventually decided on, so someone else will have to review those details.

Everything else looked good!

Copy link
Copy Markdown
Collaborator

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

This is excellent. Covers all I would expect. I'll defer to others for verifying accuracy of the nuances of tokens and settings.

@edonehoo edonehoo requested review from lboehling and mcoker April 10, 2026 15:17
@edonehoo
Copy link
Copy Markdown
Collaborator Author

@lboehling @mcoker Could you help verify the accuracy of what I've added in this pr? any suggestions or clarifications are much appreciated!

@edonehoo
Copy link
Copy Markdown
Collaborator Author

edonehoo commented Apr 30, 2026

note: I'll wait want to do a follow up once our design kit is updated, so that the Figma-related instructions are fully accurate and cover the new options. Will also want to add an image for glass mode and maybe the default vs project felt theme, but also need the design kit to be updated first

this could merge first & I could update after, or we could wait. Either way

@edonehoo edonehoo requested a review from lboehling May 18, 2026 18:44

There are a few technical constraints to abide by when using glass in your product.

- **No glass-on-glass layering:** Never layer glass-enabled containers. Doing so can cause significant performance and accessibility problems. For example, child objects inside a blurred parent container can become illegibly blurred themselves. To mitigate this, we have intentionally adjusted the opacity of our background color design tokens to simulate depth without introducing extra blur.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

might be worth noting that we have introduced opaque styles for any items that are floating directly on top of glass elements (i.e. sticky sections, menus, popovers, overlay drawers, etc.)


| Token | Value (in Project Felt theme) | Usage |
| --- | --- | --- |
| `--pf-t--global--background--color--glass--primary--default` | Light mode value: #FFFFFF (60% opacity) <br /> Dark mode value: #292929 at 50% opacity | Base fill for glass containers. |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

50% in both themes.

| Token | Value (in Project Felt theme) | Usage |
| --- | --- | --- |
| `--pf-t--global--background--color--glass--primary--default` | Light mode value: #FFFFFF (60% opacity) <br /> Dark mode value: #292929 at 50% opacity | Base fill for glass containers. |
| `--pf-t--global--background--filter--glass--default` | Light mode value: #C7C7C7 (25% opacity) <br /> Dark mode value: #C7C7C7 (15% opacity) | Overlay tint used to enhance blur visibility. |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we dropped this to a lower 16% blur in both themes. also this is not an overlay tint, its the actual blur value!

| --- | --- | --- |
| `--pf-t--global--background--color--glass--primary--default` | Light mode value: #FFFFFF (60% opacity) <br /> Dark mode value: #292929 at 50% opacity | Base fill for glass containers. |
| `--pf-t--global--background--filter--glass--default` | Light mode value: #C7C7C7 (25% opacity) <br /> Dark mode value: #C7C7C7 (15% opacity) | Overlay tint used to enhance blur visibility. |
| `--pf-t--global--border--color--glass--default` | Light mode value: #FFFFFF (60% opacity) <br /> Dark mode value: #292929 (50% opacity) | Boundary highlight for glass surfaces. |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this references our border--color--alt token in glass mode (which maps to primary bkg color)

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.

thanks erin! left a few comments in line!

other questions/notes --

  • I've added some details around adjusting the additional themes and modes in the PF6 Component Library. This could be a helpful reference for the figma section of the theming overview page.

  • in the glass handbook -- do we want to mention the addition of "plain" variants across several components so that they receive a transparent bkg when placed on a glass element? most of these are turned on my default in glass mode i believe.

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.

🎉

…s-and-styles/styles/theming/theming.md

Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
High contrast can be enabled manually by users or triggered automatically by OS- and browser-level accessibility settings such as forced colors mode. System-level preferences take precedence over PatternFly theme settings, so users who have already configured high contrast in their OS or browser will get a consistent experience without conflict.

## Using themes in Figma
**Note:** Activating high contrast mode will override and disable glass mode&mdash;whether triggered manually or via the OS-level `prefers-reduced-transparency` media query.
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.

This may be known/implied here, and it's kind of a nit picky detail, but I'll just mention that this doesn't happen automatically from patternfly. If someone using patternfly applies the glass theme class and the high contrast class, they'll get a mix of styles. It would be up to the user to make sure that glass and high contrast theme are not applied at the same time.

- **Layout variations:** A banded masthead (with a solid fill and shadowed border to anchor it above the page) and a floating side navigation (with a solid fill and shadow to visually separate it from glass content) are automatically used in place of their standard counterparts.

### High contrast mode
Products using glass mode must provide users a clear way to switch to default contrast or high contrast. When high contrast is enabled—manually or via the OS-level `prefers-reduced-transparency` media query&mdash;glass effects are automatically disabled.
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.

Same comment here as https://github.com/patternfly/patternfly-org/pull/4983/changes#r3276026525. Just want to make sure it's clear that this isn't provided by patternfly - it's up to users to make sure they respect users' preferences. Also along with prefers-reduced-transparency, there is a prefers-contrast media query that should be respected.

- **Never use a palette token**: Do not use palette tokens (like `--pf-t--color--blue--20`) directly in your code, as the value is not guaranteed to be consistent across themes.
- **Use scalable icons:** For icons, use vector images (SVG) or icon fonts instead of raster or bitmap images (PNG, JPEG, GIF, BMP, and so on). This allows you to control their color with CSS `fill` and `color` properties. By assigning a design token to these properties, your icons will automatically change color to match the active theme.
- If you must use static images, you might need to hide and show different image files based presence of a theme-specific class (like `pf-v6-theme-dark`). No newline at end of file
- If you must use static images, you might need to hide and show different image files based presence of a theme-specific class (like `pf-v6-theme-dark`).
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.

dot for consistency since it's used in the other classes in this doc.

Suggested change
- If you must use static images, you might need to hide and show different image files based presence of a theme-specific class (like `pf-v6-theme-dark`).
- If you must use static images, you might need to hide and show different image files based presence of a theme-specific class (like `.pf-v6-theme-dark`).

When glass is enabled, the following changes will apply:
- **Transparency, blur, and shadows:** Surface-level container backgrounds become semi-transparent and apply blur and shadow adjustments, letting content below subtly show through to create a sense of depth and content hierarchy.
- **Background image:** A brand-approved background image fills the page body, providing the visual layer that glass containers sit above. Product teams must use approved images and ensure text is never placed outside of a container and directly on top of a background image.
- **Component-level glass:** Glass automatically applies to the login page, masthead, navigation, and page. It can be manually extended to cards, drawers, and panels.
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.

Just to match the list on https://pf-org--pr-4983-site.surge.sh/foundations-and-styles/theming/glass-mode-handbook/. Not sure if it should be plural or not

Suggested change
- **Component-level glass:** Glass automatically applies to the login page, masthead, navigation, and page. It can be manually extended to cards, drawers, and panels.
- **Component-level glass:** Glass automatically applies to the login page, masthead, navigation, and page. It can be manually extended to cards, drawers, hero, and panels.

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.

NICE!!! Massive updates, and great job as always 👏

Copy link
Copy Markdown

@phcox phcox left a comment

Choose a reason for hiding this comment

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

Looks great!

@andrew-ronaldson andrew-ronaldson merged commit db882ad into patternfly:main May 21, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants