Skip to content

Commit df485e3

Browse files
edonehooaratti96mmenestrpatternfly-buildnicolethoen
authored
docs(design-tokens): Creates docs for design tokens. (#3786)
* docs(design-tokens): creates documentation for design tokens. * Working on design tokens doc structure. * Continues adding content and outlining the docs structure. * Ready design tokens docs for draft preview. * Update page info. * Add to side nav. * Adjust section label. * Update packages/documentation-site/patternfly-docs/patternfly-docs.config.js * Small typos. * Update sidebar.' q * Updates to the charts about page and charts colors page (#3759) * Updates to the charts about page and charts colors page * Update to Color-and-pattern-usage image file * Update colors-for-charts.md * Update colors-for-charts.md --------- Co-authored-by: Margot <51165119+mmenestr@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.21 - @patternfly/documentation-framework@5.2.21 * Update broken links on menu accessibility docs * Update broken links on menu design guidelines * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.22 - @patternfly/documentation-framework@5.2.22 * Removing the redudancy in the file. Use is described above the text. (#3790) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.23 - @patternfly/documentation-framework@5.2.23 * docs(design-guidelines) Updates content for consistency. (#3782) * docs(design-guidelines) Updates content for consistency. * Updates from review. * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.24 - @patternfly/documentation-framework@5.2.24 * chore(docs-framework): add class on example load (#3789) * chore(docs-framework): add class on example load * chore(example): remove dev mode check from page loaded class addition * chore(example): refactor to add class on page load event * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.25 - @patternfly/documentation-framework@5.2.25 * docs(terminology): Updates n/a and -- descriptions for clarity. (#3783) * docs(terminology): Updates n/a and -- descriptions for clarity. * Update packages/documentation-site/patternfly-docs/content/design-guidelines/content/terminology.md * Update packages/documentation-site/patternfly-docs/content/design-guidelines/content/terminology.md * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.2.26 - @patternfly/documentation-framework@5.2.26 * feat(dark-theme): replace dark theme switcher with toggle group (#3788) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.0 - @patternfly/documentation-framework@5.3.0 * chore(JumpLinks): updated a11y docs to match template (#3808) * fix(react-drag-drop): add react-drag-drop to latest version (#3801) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.1 - @patternfly/documentation-framework@5.3.1 * fix: clean up versions and showdown deps (#3816) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.2 - @patternfly/documentation-framework@5.3.2 * Added expand/collapse all cards info (#3815) * Added expand/collapse all cards info * Update card-view.md * Update card-view.md --------- Co-authored-by: Margot <51165119+mmenestr@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.3 - @patternfly/documentation-framework@5.3.3 * fix: add charts dark theme stylesheet (#3802) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.4 - @patternfly/documentation-framework@5.3.4 * fix(drag drop): add drag drop to 5.1 versions.json (#3817) * fix(react-drag-drop): add react-drag-drop to latest version * fix(drag drop): add to 5.1 version * remove form 5.0 * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.5 - @patternfly/documentation-framework@5.3.5 * fix: add virtualized table to extensions staging (#3819) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.6 - @patternfly/documentation-framework@5.3.6 * chore(Sidebar): updated a11y docs (#3813) * chore(AboutModal): updated a11y docs to match template (#3796) * chore(AboutModal): updated a11y docs to match template * Added alt text content to additional sections * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.7 - @patternfly/documentation-framework@5.3.7 * Makes some content updates. * fix: prepare org for component groups release (#3822) * fix: prepare org for component groups release * bump to component groups to 5.0.0 * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.8 - @patternfly/documentation-framework@5.3.8 * Update github actions to add new issues to project board (#3818) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.9 - @patternfly/documentation-framework@5.3.9 * docs(accessibility-fundamentals): Updates content as part of audit. (#3762) * docs(accessibility-fundamentals): Updates content as part of audit. * Updates content and adjusts file name. * Content tweaks. * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-fundamentals.md * Test page name change * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-fundamentals.md * Some final tweaking to ready draft for review. * Apply suggestions from code review Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-fundamentals.md * Updates to file name. --------- Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * docs(patternfly-accessibility): Updates content as part of content audit. (#3772) * docs(patternfly-accessibility): Updates content as part of content audit. * Update packages/documentation-site/patternfly-docs/content/developer-resources/patternfly-accessibility.md * Update packages/documentation-site/patternfly-docs/content/developer-resources/patternfly-accessibility.md Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * Apply suggestions from code review * Update packages/documentation-site/patternfly-docs/content/developer-resources/patternfly-accessibility.md * Update packages/documentation-site/patternfly-docs/content/developer-resources/patternfly-accessibility.md Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> --------- Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * docs(accessibility-development): Updates documentation as part of content audit. (#3780) * docs(accessibility-development): Updates documentation as part of content audit. * Test adding screen reader info here. * Test name change to adjust nav * Apply suggestions from code review Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-development.md * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-development.md * Updates content. * Apply suggestions from code review * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-development.md * Updates development techniques table content. * Continues editing content. * Content updates. --------- Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> * docs(accessibility-scorecard): Updates content as part of content audit. (#3774) * docs(accessibility-scorecard): Updates content as part of content audit. * Update packages/documentation-site/patternfly-docs/content/developer-resources/accessibility-scorecard.md * Final tweaks to ready content for review. * Updates content. * chore(deps): add react as a dep at the root level (#3834) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.10 - @patternfly/documentation-framework@5.3.10 * chore(Skeleton): updated a11y docs to match template (#3824) * chore(HelperText): updated a11y docs to match template (#3805) * chore(HelperText): updated a11y docs to match template * Removed interactive content bullet from design guidelines * chore(ExpandableSection): updated a11y docs to match template (#3803) * chore(ExpandableSection): updated a11y docs to match template * Added content regarding multiple sections on a page * Added atttributes to html table * chore(CodeEditor): updated a11y documentation to match template (#3799) * chore(CodeEditor): updated a11y documentation to match template * Removed unused import * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.11 - @patternfly/documentation-framework@5.3.11 * chore(deps): bump semver from 5.7.1 to 5.7.2 (#3841) Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](npm/node-semver@v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @babel/traverse from 7.18.6 to 7.23.6 (#3842) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.18.6 to 7.23.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.6/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.12 - @patternfly/documentation-framework@5.3.12 * docs(level): expands design guidelines for level layout. (#3673) * docs: expands design guidelines for level layout. * Expands content. * Image placeholders. * Adds content to ready for review. * Apply suggestions from code review * Remove image placeholders * [Snyk] Fix for 1 vulnerabilities (#3828) * fix: packages/documentation-framework/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 * address breaking change in glob * more version bumps * update screenshot command --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io> Co-authored-by: nicolethoen <nthoen@redhat.com> * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.13 - @patternfly/documentation-framework@5.3.13 * chore(deps): bump postcss from 8.4.31 to 8.4.32 (#3844) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.31 to 8.4.32. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.31...8.4.32) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.14 - @patternfly/documentation-framework@5.3.14 * [Snyk] Security upgrade puppeteer from 18.2.0 to 19.7.3 (#3843) * fix: packages/documentation-framework/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 * update yarn.lock --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io> Co-authored-by: nicolethoen <nthoen@redhat.com> * chore(deps): bump qs from 6.5.2 to 6.5.3 (#3309) Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](ljharb/qs@v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: try a v6 release * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.0 - @patternfly/documentation-framework@6.0.0-alpha.1 * fix: use surge for v6 staging rather than aws bucket * fix: bump docs-framework version in docs-site * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.1 - @patternfly/documentation-framework@6.0.0-alpha.2 * fix: try publish v6 to aws (#3845) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.2 - @patternfly/documentation-framework@6.0.0-alpha.3 * fix: update white space to test publishing to aws * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.3 - @patternfly/documentation-framework@6.0.0-alpha.4 * fix: PF brand logo in masthead to inline svg * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.4 - @patternfly/documentation-framework@6.0.0-alpha.5 * fix: bump puppeteer (#3858) * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.5 - @patternfly/documentation-framework@6.0.0-alpha.6 * fix: Update brand svg id to avoid duplicate ids * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.6 - @patternfly/documentation-framework@6.0.0-alpha.7 * Fix: update logo svg (#3861) * fix: update logo svg * fix: update logo svg * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.7 - @patternfly/documentation-framework@6.0.0-alpha.8 * fix: Update versions.json to include drag drop alpha * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.8 - @patternfly/documentation-framework@6.0.0-alpha.9 * fix: bump docs framework version * chore(release): releasing packages [ci skip] - @patternfly/ast-helpers@1.3.15-alpha.9 - @patternfly/documentation-framework@6.0.0-alpha.10 * Continued edits. * Working on content. * Updates design info and adds images. * Updates to images. * Continued content updates. * Smooths out formatting and content. * add all tokens documentation * bump to design-tokens version with versioned css --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: aratti96 <105744045+aratti96@users.noreply.github.com> Co-authored-by: Margot <51165119+mmenestr@users.noreply.github.com> Co-authored-by: patternfly-build <patternfly-build@redhat.com> Co-authored-by: Nicole Thoen <nthoen@redhat.com> Co-authored-by: kuklas <78739379+kuklas@users.noreply.github.com> Co-authored-by: Austin Sullivan <ausulliv@redhat.com> Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com> Co-authored-by: Katie Edwards <94569315+kaedward@users.noreply.github.com> Co-authored-by: Jessie <jhuff@redhat.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patternfly Build <patternfly-build@users.noreply.github.com> Co-authored-by: snyk-bot <snyk-bot@snyk.io>
1 parent efb38df commit df485e3

File tree

14 files changed

+157
-0
lines changed

14 files changed

+157
-0
lines changed

packages/documentation-framework/scripts/webpack/webpack.base.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ module.exports = (_env, argv) => {
4747
/react-[\w-]+\\src\\.*\\examples/, // fix for Windows
4848
/react-[\w-]+\/patternfly-docs\/.*\/examples/, //fixes for extensions
4949
/react-[\w-]+\\patternfly-docs\\.*\\examples/,
50+
path.resolve(__dirname, '../../../../node_modules/@patternfly/design-tokens/patternfly-docs/content')
5051
].concat(includePaths.map(path => new RegExp(path))),
5152
exclude: [
5253
path.resolve(__dirname, '../../node_modules'), // Temporarily compile theme using webpack for development

packages/documentation-framework/templates/mdx.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
margin-bottom: var(--pf-v6-c-content--MarginBottom);
5151
}
5252

53+
.ws-image {
54+
text-align: center;
55+
width: "600px";
56+
}
57+
5358
/* Table styles */
5459
/* Undo patternfly reset to respect MD table styles */
5560
.ws-table td[align="center"],
@@ -68,6 +73,7 @@
6873
table-layout: fixed;
6974
width: 100%;
7075
}
76+
7177
.ws-table td > code,
7278
.ws-table th > code,
7379
.ws-table tr > code {

packages/documentation-site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@patternfly/react-user-feedback": "5.0.0",
2828
"@patternfly/react-component-groups": "5.0.0-prerelease.10",
2929
"@patternfly/react-virtualized-extension": "5.0.0",
30+
"@patternfly/design-tokens": "1.0.2",
3031
"react": "^17.0.0 || ^18.0.0",
3132
"react-dom": "^17.0.0 || ^18.0.0",
3233
"showdown": "^2.1.0"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
id: About tokens
3+
section: tokens
4+
---
5+
6+
**Design tokens** are variables that store visual design attributes like color, typography, and spacing. Tokens have a name and value that conveys their associated design style, making their purpose clear and recognizable.
7+
8+
PatternFly's tokens are set up as variables and styles within Figma, and are exported as CSS variables for use in development. Tokens are only available as part of the PatternFly 6 release, so make sure you [upgrade to PatternFly 6](/get-started/upgrade) in order to take advantage of tokens.
9+
10+
To learn more about designing with the PatternFly Figma library, [refer to our onboarding guide.](/get-started/design#figma-library)
11+
12+
You can also [view the complete list of PatternFly's design tokens.](/tokens/all-patternfly-tokens)
13+
14+
## Why use tokens?
15+
16+
A token system enables a a shared language for building UIs and helps support better consistency and maintenance across the PatternFly design system.
17+
18+
### Consistency
19+
Tokens help maintain consistency across product design processes by ensuring that the same colors and styles are always used for the same use cases. By removing the decision making that would otherwise go into choosing the right color, heading level, spacing, and so on, designs can be created more consistently and efficiently.
20+
21+
### Easier maintenance
22+
Tokens also enable easier design system maintenance. Whenever a color is changed as part of a redesign or update, all related tokens are automatically updated to reflect this change. This means that developers won't have to make any code changes to ensure that a product is up to date with the latest PatternFly recommendations. Likewise, designers will see that their Figma designs automatically update to reflect any changes made to tokens.
23+
24+
## Token names
25+
26+
PatternFly token names are composed of a `--pf-t` prefix, a version number, and a series of token segments, separated by double hyphens.
27+
28+
<div class="ws-image" style="text-align: center;">
29+
<img src="./img/token-name.png" alt="PatternFly token naming structure." width="600px"/>
30+
</div>
31+
<br />
32+
33+
Each token segment represents a different type of style information. If a segment isn't relevant for a particular token then it will be skipped in the token's name.
34+
35+
| **Segment** | **Description** |
36+
| --- | --- |
37+
| Scope | The token's range, such as *global* or *chart*.
38+
| Component | The component that the token relates to, such as *icon*, *background*, or *text*.
39+
| Property | The style property of a component, such as *color*, *size*, *width*, or *radius*.
40+
| Concept | The token's higher level concepts, such as *status*, *primary*, or *action*, which have different variant options.
41+
| Variant | The variant of a component or concept, such as *link*, *plain*, *warning*, or *success*.
42+
| State | The state that the component is in, such as *default*, *hover*, or *active*.
43+
44+
## Token layers
45+
46+
The PatternFly token system has 3 layers: palette tokens, base tokens, and semantic tokens.
47+
48+
* **Palette tokens** use [PatternFly color palettes](/design-foundations/colors#patternfly-palettes) to create a color foundation for other token layers to reference.
49+
50+
* **Base tokens** expand on the palette layer to apply PatternFly colors to concepts. They also introduce additional concepts, like spacing and borders. Base tokens are grouped conceptually and named numerically, with no duplicate values in a concept group.
51+
52+
* **Semantic tokens** are the top-level tokens that are grouped conceptually and named semantically. These are built with base tokens and are the tokens that you will see and use the majority of the time. The naming is intentionally chosen to support the proper and relevant use of a token, which makes design consistency easier for everyone.
53+
54+
<div class="ws-image" style="text-align: center;">
55+
<img src="./img/token-layers-example.png" alt="PatternFly token layer names for the same color value." width="600px"/>
56+
</div>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
id: Design with tokens
3+
section: tokens
4+
---
5+
6+
## Penta design kit
7+
8+
PatternFly tokens are only available as part of the PatternFly 6 [Penta design kit.]() In order to make use of our token system, you will need to [upgrade to PatternFly 6](/get-started/upgrade).
9+
10+
## What is in the Penta design kit
11+
12+
### Tokens
13+
14+
Our tokens are set up at a high level as Figma [variables](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma) and [styles](https://help.figma.com/hc/en-us/articles/360039238753-Styles-in-Figma).
15+
16+
In Figma, the variable names look similar to [token names](/tokens/all-patternfly-tokens), but will be separated by a forward slash (/) instead of a double hyphen (--).
17+
18+
<div style="text-align: center;">
19+
<img src="./img/token-example-brand.png" alt="Table of brand color tokens." width="600px"/>
20+
</div>
21+
<br />
22+
23+
### Penta component library
24+
25+
You will have access to all PatternFly tokens when you install the component library. Penta components are built with tokens. From the colors used, to the spacing of elements, to the font size: tokens control it all!
26+
27+
<div style="text-align: center;">
28+
<img src="./img/component-tokens.png" alt="PatternFly alert components built with Figma tokens." width="700px"/>
29+
</div>
30+
31+
## Using the Penta design kit
32+
33+
To install the Penta design kit, [find instructions in our design onboarding guide.](/get-started/design#figma-library)
34+
35+
### Using Penta components
36+
37+
As you insert a component into a design workspace, you can adjust properties and variable modes to customize the appearance to your needs.
38+
39+
<div style="text-align: center;">
40+
<img src="./img/component-instance.png" alt="PatternFly alert components built with Figma tokens." width="350px"/>
41+
</div>
42+
<br />
43+
44+
Once you've inserted a component into your workspace, you can continue to customize different parts of its appearance in [Figma's design sidebar](https://help.figma.com/hc/en-us/articles/360039832014-Design-prototype-and-explore-layer-properties-in-the-right-sidebar). Here, you will be able to see all tokens that can be used within a particular design property.
45+
46+
### Making customizations
47+
48+
Occasionally, you may find that you need to customize a design beyond what the PatternFly component natively supports. For example, adding text or adding custom spacing.
49+
50+
Our tokens are intentionally scoped so that they can only be used to modify relevant and related visual attributes. For example, a token may have its color scope limited so that it can only be used as a fill color or a stroke color. This means that, while you can use tokens to customize a design, you will only be able to use certain tokens in certain situations. This helps ensure that you're using tokens that are conceptually related to each design element that you're working on.
51+
52+
## Migrate to tokens
53+
54+
Our tokens are only available within Figma. If you've previously designed with PatternFly by using our Sketch design kits, you will need to begin to create all new product designs within Figma.
55+
56+
If you have any existing Sketch-based designs that you want to migrate into Figma, you will need to manually recreate each UI mockup using the Penta component library.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
id: Develop with tokens
3+
section: tokens
4+
---
5+
6+
## Using tokens in code
7+
8+
PatternFly tokens are exported from Figma and transformed into CSS variables for use in code. You can find token files in [PatternFly's core HTML repo](https://github.com/patternfly/patternfly/tree/v6/src/patternfly/base/tokens) and refer to [our list of all tokens](/tokens/all-patternfly-tokens).
9+
10+
When using tokens in code: if there's a semantic token that matches your needs then you should always use that. In the event that there isn't a semantic token, then you can use a base token. You should not use palette tokens, as they are the foundation of our token system and there should always be a better base or semantic token to use.
11+
12+
### Dark theme support
13+
14+
Our token system is available for both light and dark themes. We have [separate tokens for dark theme](https://github.com/patternfly/patternfly/blob/v6/src/patternfly/base/tokens/_tokens-dark.scss) to ensure proper contrast ratios. For guidance on enabling and supporting dark theme in your product, refer to our [dark theme handbook.](/developer-resources/dark-theme-handbook)
15+
16+
## Migrate to tokens
17+
18+
To support tokens, PatternFly's global CSS variable system has been updated and variable names have been updated across all PatternFly components and extensions. To migrate to our token system, all you need to do is [upgrade to PatternFly 6](/get-started/upgrade).
19+
20+
However, if you make customizations to PatternFly components in your product, or use CSS overrides, you will need to manually update your CSS variable names to match an appropriate [token variable](/tokens/all-patternfly-tokens). There is no one-to-one recommendation for any particular CSS variable, so you will need to choose the most appropriate token for your use case.
21+
22+
Once you've completed your migration, you're ready to continue developing with tokens!
132 KB
Loading
442 KB
Loading
127 KB
Loading
301 KB
Loading

0 commit comments

Comments
 (0)