diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/colors/colors.md b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/colors/colors.md index 54abc437e5..8d3fbc0d6d 100644 --- a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/colors/colors.md +++ b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/colors/colors.md @@ -191,6 +191,8 @@ Status and state colors are indicators that communicate data and actions to user To check the contrast between background and text colors, use a WCAG AA-compliance tool. +Beyond our standard contrast ratio, we support a high contrast and a glass contrast mode, as documented in our [theming guidelines](/foundations-and-styles/theming#contrast-modes). + ## Color families Our color palettes are organized into "families" that contain different shades of the same hue. In the following families, you can expand each color to see related tokens. diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/glass-mode-handbook.md b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/glass-mode-handbook.md new file mode 100644 index 0000000000..22da0c0106 --- /dev/null +++ b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/glass-mode-handbook.md @@ -0,0 +1,118 @@ +--- +id: Theming +section: foundations-and-styles +source: glass-mode-handbook +--- + +# Glass mode developer handbook + +Glass mode is a contrast mode option that can be manually enabled in both our Default and Project Felt themes. Glass adds transparency, blurring, and depth to the UI to create a more dynamic visual effect where brand-approved background images and layered UI elements subtly show through. + +When turned on, glass applies to the following components, including their uses within our extensions: +- Login page +- Masthead +- Navigation +- Page + +Additionally, glass can be manually enabled on the following components, via the `isGlass` prop: +- Card +- Drawer +- Hero +- Panel + +Many components also support the `isPlain` prop, which removes their default solid background color so they can sit directly on a glass-enabled surface without obscuring the intended depth effect. + +## Glass-specific component variants + +When glass is enabled, two component variants are automatically applied in place of their standard counterparts to help anchor the experience: + +- **Banded masthead:** Adds a solid fill color and shadowed border to the masthead, setting it apart as a persistent dock above the rest of the page. +- **Floating side navigation:** Adds a solid fill color and shadowed border to the side navigation, insetting it to make it visually elevated and clearly readable as a navigation resource within the glass context. + +## Background images + +The glass effect is most visible when placed over a background image. To retain readability and ensure proper contrast ratios are met, images shouldn't contain high levels of detail or extreme contrast. + +Background images, including non-branded and product-specific options are available to download from the [Red Hat brand portal](https://redhat.brand-portal.adobe.com/mediaportal.html/content/dam/mac/redhat/brand/brand-engagement-kit/wallpapers/product-interface-backgrounds?disableExpiredRedirect=true). If a Red Hat product team does not want to use one of the premade background options, then customized background images must be created in collaboration with the brand team. + +Text must never be placed directly on a background image—it should be placed within a container that has a background color or glass effect. Titles or headings with stronger font weights can be placed directly on background images only if they pass specific brand and contrast requirements. + +### Default background images + +PatternFly includes background images for the glass theme and automatically applies them when you pull in PatternFly styles. Two sets of images are provided: + +- **Default PatternFly theme:** `PF-Bkg-Generic-Light.svg` and `PF-Bkg-Generic-Dark.svg` +- **Project Felt theme:** `Felt-Bkg-Generic-Light.svg` and `Felt-Bkg-Generic-Dark.svg` + +The path to these images depends on how you pull in PatternFly styles. + +**From `@patternfly/patternfly`** (typically via `@patternfly/patternfly/patternfly.css`): +``` +@patternfly/patternfly/assets/images/ +``` + +**From `@patternfly/react-core`** (via `@patternfly/react-core/dist/styles/base.css`): +``` +@patternfly/react-core/dist/styles/assets/images/ +``` + +As long as you include PatternFly CSS through one of those two methods, the background images will be applied automatically. + +### Customizing background images + +If you are not using one of the standard import paths, or you want to supply your own images, you can override the following CSS variables. Overrides should be scoped to the `:root` selector. + +| Variable | Default value | Usage | +| --- | --- | --- | +| `--pf-t--global--background--image--glass` | `url("./assets/images/PF-Bkg-Generic-Light.svg")` | Default/glass light theme background image | +| `--pf-t--global--background--image--glass--dark` | `url("./assets/images/PF-Bkg-Generic-Dark.svg")` | Default/glass dark theme background image | +| `--pf-t--global--background--image--felt--glass` | `url("./assets/images/Felt-Bkg-Generic-Light.svg")` | Felt/glass light theme background image | +| `--pf-t--global--background--image--felt--glass--dark` | `url("./assets/images/Felt-Bkg-Generic-Dark.svg")` | Felt/glass dark theme background image | + +For example, to override both dark theme background images, add this to your application's CSS: + +```css +:root { + --pf-t--global--background--image--glass--dark: url(../backgrounds/custom/my-glass-dark-image.jpg); + --pf-t--global--background--image--felt--glass--dark: url(../backgrounds/custom/my-felt-glass-dark-image.jpg); +} +``` + +## Opacity + +The default opacity values used in our components have been tested for accessibility, legibility, and visual appeal. Glass surfaces (page, masthead, navigation, and similar components) use 50% opacity in both light and dark mode, with a background blur effect applied. + +If a product team chooses to override these token values, they are responsible for conducting their own accessibility evaluation to ensure WCAG compliance. + +## Enabling glass mode + +Glass mode is designed to work across light and dark color schemes in both our Default and Project Felt themes. To enable glass, add the class `.pf-v6-theme-glass` to your application’s `` tag. When implementing glass, it’s important to ensure that it does not harm the overall accessibility or usability of your product. + +### Technical constraints + +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. +- **High contrast precedence:** If high-contrast mode is enabled, all glass effects must be automatically disabled to prioritize functional accessibility. +- **User controls and preferences:** Because some users might experience legibility issues in glass mode, any product utilizing glass must also let users swap to default contrast or high contrast via a theme switcher or preferences menu. Products should also respect the OS-level `prefers-reduced-transparency` media query, disabling glass or replacing it with a solid high-opacity background to accommodate users appropriately. + +## Glass design tokens + +The following tokens are used together to create the glass effect. + +| Token | Value | Usage | +| --- | --- | --- | +| `--pf-t--global--background--color--glass--primary--default` | Light mode value: #FFFFFF (50% opacity)
Dark mode value: #292929 (50% opacity) | Base fill for glass containers. | +| `--pf-t--global--background--filter--glass--default` | Light mode value: 16% blur
Dark mode value: 16% blur | Amount of blur applied to an element. | +| `--pf-t--global--border--color--glass--default` | `--pf-t--global--border--color--alt` | Boundary highlight for glass surfaces. | +| `--pf-t--global--border--radius--glass--default` | `--pf-t--global--border--radius--medium` | Rounded border for glass elements. | +| `--pf-t--global--box-shadow--glass--default` | `--pf-t--global--box-shadow--md` | Shadow that signifies elevation. | + +**Note:** `--pf-t--global--background--color--sticky--default` is not a glass-specific token, but it is relevant in glass contexts by providing a solid background for non-glass elements (like sticky headers) that sit directly on top of glass content. + +## Best practices + +To ensure a successful implementation, follow these best practices: +- Ensure all text meets a 4.5:1 (AA) contrast ratio. +- Ensure that high contrast mode overrides any use of glass to maintain accessibility requirements. +- Always verify glass components against both light and dark background variations to catch contrast failures early. \ No newline at end of file diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/high-contrast-handbook.md b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/high-contrast-handbook.md index bd7c4f7589..799389f47a 100644 --- a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/high-contrast-handbook.md +++ b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/high-contrast-handbook.md @@ -6,11 +6,15 @@ source: high-contrast-handbook # High contrast mode developer handbook +High contrast mode increases the contrast of PatternFly components to support users with low vision or other visual impairments for whom higher contrast is a necessity. Our standard light and dark modes meet WCAG AA contrast ratios (4.5:1 for text), but high contrast mode goes further, targeting WCAG AAA text contrast ratios of 7:1. It also raises non-text element contrast (interactive elements and boundaries) to 4.5:1, and applies global border rules that define clear boundaries in place of shadows and subtle background fills, which can disappear in high contrast environments. + +High contrast mode works across both the Default and Project Felt themes, in light and dark color schemes. + ## High contrast mode vs. forced colors mode Our high contrast mode increases the contrast of PatternFly components, often introducing additional borders to distinguish between elements, states, and interactions that otherwise rely on subtle background colors. High contrast mode is enabled by applying styles that are meant to target the [`prefers-contrast: more`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast) media query, which is the mode triggered on MacOS via **System Settings** > **Accessibility** > **Display** > **Increase contrast**. -This is different from [`forced-colors: active`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors), which is a more aggressive contrast mode where the browser enforces a limited, user-chosen color palette on a webpage, often by replacing author-defined colors with CSS system colors and removing styles like background colors and box shadows. Common triggers for forced colors mode are enabling Windows High Contrast Mode and Firefox High Contrast Mode. As outlined in [“Automatic high contrast”](#automatic-high-contrast), we recommend applying high contrast mode when `forced-colors: active` is `true`. +This is different from [`forced-colors: active`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors), which is a more aggressive contrast mode where the browser enforces a limited, user-chosen color palette on a webpage, often by replacing author-defined colors with CSS system colors and removing styles like background colors and box shadows. Common triggers for forced colors mode are enabling Windows High Contrast Mode and Firefox High Contrast Mode. As outlined in [“Automatic high contrast”](#automatic-high-contrast), we recommend applying high contrast mode when the value of the `forced-colors` media query is `active`. ## Enabling high contrast mode @@ -51,6 +55,10 @@ We also added the following tokens for plain actions (actions with a transparent | `--pf-t--global--border--width--action--plain--hover` | 0px | `--pf-t--global--border--width--100`

Value: 1px | | `--pf-t--global--border--width--action--plain--clicked` | 0px | `--pf-t--global--border--width--200`

Value: 2px | +## High contrast and glass mode + +To ensure functional accessibility always takes priority when users need it, high contrast mode and glass mode are mutually exclusive. When high contrast mode is enabled manually or via the OS-level `prefers-reduced-transparency` media query, all glass mode effects are automatically disabled. + ## Best practices In addition to the [general theming best practices](/foundations-and-styles/theming#best-practices), ensure that you adhere to the following guidelines when working in high contrast mode. diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/contrast-and-color.png b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/contrast-and-color.png new file mode 100644 index 0000000000..a494e4ee35 Binary files /dev/null and b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/contrast-and-color.png differ diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/project-felt.png b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/project-felt.png new file mode 100644 index 0000000000..c2e0bee000 Binary files /dev/null and b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/img/project-felt.png differ diff --git a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/theming.md b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/theming.md index 8baa660e31..b1236c3748 100644 --- a/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/theming.md +++ b/packages/documentation-site/patternfly-docs/content/foundations-and-styles/styles/theming/theming.md @@ -8,17 +8,48 @@ import '../../../components/components.css' import { Alert, AlertActionLink} from '@patternfly/react-core'; import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon'; -A **theme** applies a specific visual style to all UI components in order to create a unique, cohesive, and purposeful look. The use of theming can provide more flexibility for user preferences, as well as different options for accessibility needs. +A **theme** applies specific visual styles to UI components to create a unique, cohesive, and purposeful look. Our theming architecture leverages [our design token system](/foundations-and-styles/design-tokens/overview) to flexibly support different brand identities, user preferences, and accessibility needs. -Theming is supported in PatternFly through [our design token system](/foundations-and-styles/design-tokens/overview), which was intentionally structured so that sets of tokens can be adjusted together to create alternate UI styles. By reassigning token values, the fonts, spacing, shadows, and borders in a UI can be changed together to create a theme. This system has enabled us to create multiple PatternFly themes, while also supporting the ability for you to create custom themes. +## Theming architecture -## PatternFly themes +We utilize a tiered theming architecture to consistently manage the appearance of UIs: +- **Theme:** Defines the foundational brand appearance, including core colors, border radii, iconography, and assets. +- **Color scheme:** Controls the brightness and palette shifts between light and dark environments. +- **Contrast mode:** Adjusts the style of surfaces and elements for specific aesthetic or accessibility needs. -The following themes are currently supported across PatternFly components and are designed to meet specific [WCAG accessibility standards](https://www.w3.org/WAI/standards-guidelines/wcag/). You can explore our different themes on our website by toggling your display preferences in our site's masthead dropdown. +## Themes + +We support 2 pre-built themes in PatternFly. While the visual identity of each theme differs, they share the same underlying interaction patterns and accessibility standards. + +### Default theme + +The Default theme creates the standard, open source PatternFly experience. It is characterized by blue branding and modern, square borders. + +### Project Felt theme + +Named after the material of the iconic Red Hat fedora, Project Felt is designed for products within the Red Hat portfolio, providing closer alignment with the [Red Hat Design System (RHDS)](https://ux.redhat.com/). It replaces PatternFly blue with Red Hat red as an accent color and introduces pill-shaped borders for buttons, controls, and containers, making product UIs feel recognizably Red Hat. + +Project Felt is part of a broader, long-term effort to create a more seamless experience for customers across the full Red Hat journey—from marketing sites and the product marketplace to complex enterprise software—developed in collaboration with RHDS. + +Because Project Felt is built on our design token system, you can adopt it without breaking changes. To enable it, add `.pf-v6-theme-felt` to your application's `` tag. You can preview it alongside our other theming options on PatternFly.org via the masthead theme switcher. + +### Custom themes + +To branch off of our themes and create your own, you can identify the design tokens you'd like to adjust on our [all tokens page](/foundations-and-styles/design-tokens/all-design-tokens) and provide new values to use within your application. + +#### When to customize a theme + +There are a couple of instances when you might want to adjust an existing PatternFly theme: +- One-off adjustments, like changing a single button color, spacer, or font size, when intentional deviation is needed across your product. +- Application-wide adjustments, like changing all button colors and font sizes to adjust the overall brand identity of your product. + +## Color schemes ### Light mode -Generally, light mode is the default appearance of PatternFly. In this mode, dark text is presented on light backgrounds to meet a [text contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#contrast-minimum), while colors for other UI elements meet a [non-text contrast ratio of at least 3:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#non-text-contrast). Some users might find it easier to read text on light screens, while others might simply prefer the appearance. +Light mode is the standard appearance for most web environments. + +Light mode places dark text on light backgrounds, while maintaining a [text contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#contrast-minimum) and a [non-text contrast ratio of at least 3:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#non-text-contrast). Some users might find light screens easier to read, while others might simply prefer the appearance.
![A collage of multiple light-themed PatternFly components, like a calendar, alert, and menu. The components have white backgrounds and black text.](./img/components-light.svg) @@ -26,68 +57,67 @@ Generally, light mode is the default appearance of PatternFly. In this mode, dar ### Dark mode -In dark mode, light text is presented on dark backgrounds backgrounds, and our color palette adapts to maintain a [text contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#contrast-minimum) and [non-text contrast ratio of at least 3:1](https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#non-text-contrast). Some users might prefer dark mode for aesthetics, while others find it to be easier on the eyes and less straining for those with light sensitivities. +Dark mode adapts color palettes for light-sensitive users or low-light environments. It presents light text on dark backgrounds while maintaining the same accessibility ratios as light mode. Some users might prefer dark mode for aesthetics, while others find it to be easier on the eyes and less straining for those with light sensitivities. -For development guidance, refer to the [dark theme handbook](/foundations-and-styles/theming/dark-theme-handbook). +For implementation guidance, refer to the [dark theme handbook](/foundations-and-styles/theming/dark-theme-handbook).
![A collage of multiple dark-themed PatternFly components, like a calendar, alert, and menu. The components have dark gray backgrounds and white text.](./img/components-dark.svg)
-### High contrast mode - - -

High contrast mode is still under development and will continue to evolve and be enabled for charts and extensions. This beta allows you to preview our progress.

-
- -High contrast mode adjusts our default colors to meet an [enhanced contrast ratio of at least 7:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html), making it more suitable for users who require higher contrast between UI elements. By using wider border strokes and adjusted fill colors, high contrast mode creates more visual distinction and clarity between interactive elements. +## Contrast modes -In high contrast mode, distinct borders are also added to components to ensure that their boundaries are clearly defined without requiring users to rely on subtle background colors as a visual cue. +Contrast modes adjust the surface treatment of UI elements across both color schemes. They are mutually exclusive and can't be applied simultaneously. -For development guidance, refer to the [high contrast handbook](/foundations-and-styles/theming/high-contrast-handbook). +### Default contrast -
-![A collage of multiple PatternFly components, like a calendar, alert, and menu. The top half of the image has components on a white background with black text and the bottom half of the image has dark components on a black background with light text. All components have high contrast, with borders and noticeable colors.](./img/components-hc.svg) -
+Default contrast mode is used in the Default theme and doesn't include special enhancements to increase contrast in UI elements. This mode doesn't need to be enabled and simply refers to the standard color palette used to achieve level AA accessibility, with contrast ratios of 4.5:1 for normal text, 3:1 for large text, and 3:1 for graphics and other UI components. -## Custom themes +### High contrast -To branch off of our themes and create your own, you can identify the design tokens you'd like to adjust on our [all tokens page](/foundations-and-styles/design-tokens/all-design-tokens) and provide new values to use within your application. +High contrast mode is focused on improving accessibility for users who require more clarity and higher contrast between UI elements. It is available across the Default and Project Felt themes in both light and dark color schemes. When enabled, high contrast mode adjusts the following: -### When to customize a theme +- Raises text contrast to meet a [WCAG AAA ratio of 7:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html). +- Raises non-text element contrast (interactive elements and boundaries) to 4.5:1. +- Applies global border rules that define clear boundaries in place of shadows and subtle background fills, which can disappear in high contrast environments. -There are a couple of instances when you might want to adjust an existing PatternFly theme: -- One-off adjustments, like changing a single button color, spacer, or font size, when intentional deviation is needed across your product. -- Application-wide adjustments, like changing all button colors and font sizes to adjust the overall brand identity of your product. +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 (like `prefers-reduced-transparency` and `prefers-contrast`) 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:** PatternFly does not automatically prevent glass mode and high contrast mode from being active simultaneously. If both the glass class and the high contrast class are applied, styles will conflict. Product teams are responsible for ensuring these modes are not applied at the same time. -Our Figma libraries fully support theming. Designers can create a single design and then swap between our themes using the "Apply Variable Mode" toggles in the "Appearance" section of the component properties panel. This makes it easy to visually test and validate designs across all supported themes. +For implementation guidance, refer to the [high contrast handbook](/foundations-and-styles/theming/high-contrast-handbook). -The standard light PatternFly theme will be applied to components by default. If you want your mockups to use our dark or high contrast themes, you will need to adjust the following settings in Figma. +
+![A collage of multiple PatternFly components, like a calendar, alert, and menu. The top half of the image has components on a white background with black text and the bottom half of the image has dark components on a black background with light text. All components have high contrast, with borders and noticeable colors.](./img/components-hc.svg) +
-### Dark mode +### Glass -To swap your components to our standard dark mode, change the Semantic Color Tokens variable mode to be "Dark": +Glass mode introduces transparency, blur, and depth to the UI, creating a layered visual effect. It is available in both light and dark color schemes across the Default and Project Felt themes, and can be manually enabled in either. -
-![Figma settings menu to select different token variables.](./img/figma-dark-mode.svg) -
+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, hero, and panels. +- **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. PatternFly does not automatically disable glass effects based on user preferences, so product teams are responsible for ensuring glass is not active when users have enabled high contrast (whether manually or via OS-level media queries such as `prefers-reduced-transparency` or `prefers-contrast`). -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: +For more details, including implementation guidance, refer to the [glass mode handbook](/foundations-and-styles/theming/glass-mode-handbook). -
-![Figma settings menu to select different token variables.](./img/figma-hc-mode.svg) -
+## Feature compatibility -### Chart themes +The following table outlines the availability and compatibility of PatternFly features across themes. -Our charts use a unique token collection, so you will need to adjust chart variable modes separately from components in order to swap themes. To change the variable mode for charts, follow the same steps previously outlined for component theme adjustments. +| Feature | Default theme | Project Felt theme | +| --- | --- | --- | +| Accent color | Blue | Red | +| Interactive element colors | Blue | Blue | +| Border radius shape | Square | Pill | +| Default contrast mode | Standard | Standard | +| Background image | Optional (Manual) | Required (with glass mode) | +| Branded icons | Optional (Manual) | Default +| High contrast support | Yes | Yes | ## Best practices @@ -102,4 +132,30 @@ To ensure your application is robust, maintainable, and adaptable across differe - **Prioritize semantic tokens:** Always use the most relevant semantic token for your use case to ensure the element's purpose is clear and that it receives the correct styling in any theme. If no semantic token exists, you can fall back to a base token. - **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`). + +## Theming in Figma + +Our Figma libraries fully support theming. The standard light Default theme is applied to components by default. You can swap to any supported combination of theme (Default or Project Felt), color scheme (light or dark), and contrast mode (Default, High Contrast, or Glass) using the Appearance menu in Figma. + +**Note:** Our charts use a unique token collection, so you will need to adjust chart variable modes separately from components. To change the variable mode for charts, follow the same steps outlined for component theme adjustments. + +### Swapping themes + +Project Felt's tokens are defined within our [Styles & Components Library](https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Styles---Components) as an “extended variable collection.” When choosing appearance modes for your Figma designs, you can select between our Default PatternFly theme and the new Project Felt theme via the extended collections dropdown within the Appearance menu. You will need to set “Felt” or “Default” on both the color and dimensions collections. + +
+![Figma settings menu to select Project Felt library.](./img/project-felt.png) +
+ +### Swapping color schemes and contrast modes + +To swap between our different contrast modes (Default, High Contrast, and Glass), select your desired contrast mode in the second toggle within the Appearance menu. Each contrast mode has a light and dark color scheme defined. You must make sure that the corresponding contrast mode is set across the color token, dimension token, and chart token collections. + +
+![Figma settings menu to select different token variables.](./img/contrast-and-color.png) +
+ +### Glass style variants + +To support glass mode in Figma, we’ve added new “Style” variants across many components. Components that sit directly on top of a background image in glass mode (panel, hero, cards, page, left navigation, and masthead) have a “glass” style variant. Other components that previously had a background by default also now have a “plain” (transparent) style variant, so they can be nested inside a parent component that has glass styles without obscuring the effect. \ No newline at end of file