Skip to content

Commit 67dcfd4

Browse files
Dev docs update (#644)
* update notes in documentation * Update theming documentation * : Add theme table to documentation update with color swatches, update values to match PFE colors * : Update colors for accent to match recent update PR Co-authored-by: [ Cassondra ] <[email protected]>
1 parent d60196c commit 67dcfd4

File tree

11 files changed

+519
-334
lines changed

11 files changed

+519
-334
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
2+
+++
3+
title = "Theme palette"
4+
description = ""
5+
weight = 2
6+
draft = false
7+
bref = ""
8+
toc = true
9+
menu = "theme"
10+
tags = [ "theme" ]
11+
+++
12+
13+
<style>
14+
.color-preview {
15+
display: inline-block;
16+
width: 1em;
17+
height: 1em;
18+
vertical-align: middle;
19+
background-color: var(--bg, #fff);
20+
border: 1px solid #444;
21+
}
22+
</style>
23+
24+
## List of theme palette variables
25+
26+
These variables are global hooks to override colors, fonts, spacing and more throughout the library of web components. Generally this is all you need, though component specific variables are also available. Feel free to copy this list and define the values needed for your site or application. Please note that the logo URL paths are empty here.
27+
28+
| Variable name | Type | Project default |
29+
| ------------- | ---------- | --- |
30+
| `--pfe-theme--color--ui-base` | Color | <span class="color-preview" style="--bg:#0477a4"></span> #0477a4 |
31+
| `--pfe-theme--color--ui-base--hover` | Color | <span class="color-preview" style="--bg:#022f40"></span> #022f40 |
32+
| `--pfe-theme--color--ui-base--focus` | Color | <span class="color-preview" style="--bg:#022f40"></span> #022f40 |
33+
| `--pfe-theme--color--ui-base--text` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
34+
| `--pfe-theme--color--ui-base--text--hover` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
35+
| `--pfe-theme--color--ui-base--text--focus` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
36+
| `--pfe-theme--color--ui-complement` | Color | <span class="color-preview" style="--bg:#464646"></span> #464646 |
37+
| `--pfe-theme--color--ui-complement--text` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
38+
| `--pfe-theme--color--ui-complement--hover` | Color | <span class="color-preview" style="--bg:#131313"></span> #131313 |
39+
| `--pfe-theme--color--ui-complement--text--hover` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
40+
| `--pfe-theme--color--ui-accent` | Color | <span class="color-preview" style="--bg:#e00"></span> #e00 |
41+
| `--pfe-theme--color--ui-accent--hover` | Color | <span class="color-preview" style="--bg:#880000"></span> #880000 |
42+
| `--pfe-theme--color--ui-accent--focus` | Color | <span class="color-preview" style="--bg:#880000"></span> #880000 |
43+
| `--pfe-theme--color--ui-accent--text` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
44+
| `--pfe-theme--color--ui-accent--text--hover` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
45+
| `--pfe-theme--color--ui-accent--text--focus` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
46+
| `--pfe-theme--color--ui-disabled` | Color | <span class="color-preview" style="--bg:#d2d2d2"></span> #d2d2d2 |
47+
| `--pfe-theme--color--ui-disabled--hover` | Color | <span class="color-preview" style="--bg:#d2d2d2"></span> #d2d2d2 |
48+
| `--pfe-theme--color--ui-disabled--text` | Color | <span class="color-preview" style="--bg:#797979"></span> #797979 |
49+
| `--pfe-theme--color--ui-disabled--text--hover` | Color | <span class="color-preview" style="--bg:#797979"></span> #797979 |
50+
| `--pfe-theme--color--ui-disabled--text--focus` | Color | <span class="color-preview" style="--bg:#797979"></span> #797979 |
51+
| `--pfe-theme--color--surface--lightest` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
52+
| `--pfe-theme--color--surface--lightest--theme` | Theme descriptions (light, dark, saturated) | light |
53+
| `--pfe-theme--color--surface--lighter` | Color | <span class="color-preview" style="--bg:#ececec"></span> #ececec |
54+
| `--pfe-theme--color--surface--lighter--theme` | Theme descriptions | light |
55+
| `--pfe-theme--color--surface--base` | Color | <span class="color-preview" style="--bg:#dfdfdf"></span> #dfdfdf |
56+
| `--pfe-theme--color--surface--base--theme` | Theme descriptions | light |
57+
| `--pfe-theme--color--surface--darker` | Color | <span class="color-preview" style="--bg:#464646"></span> #464646 |
58+
| `--pfe-theme--color--surface--darker--theme` | Theme descriptions | dark |
59+
| `--pfe-theme--color--surface--darkest` | Color | <span class="color-preview" style="--bg:#131313"></span> #131313 |
60+
| `--pfe-theme--color--surface--darkest--theme` | Theme descriptions | dark |
61+
| `--pfe-theme--color--surface--complement` | Color | <span class="color-preview" style="--bg:#0477a4"></span> #0477a4 |
62+
| `--pfe-theme--color--surface--complement--theme` | Theme descriptions | saturated |
63+
| `--pfe-theme--color--surface--accent` | Color | <span class="color-preview" style="--bg:#e00"></span> #e00 |
64+
| `--pfe-theme--color--surface--accent--theme` | Theme descriptions | saturated |
65+
| `--pfe-theme--ui--border-width` | Size | 1px |
66+
| `--pfe-theme--ui--border-style` | Border settings | solid |
67+
| `--pfe-theme--ui--border-radius` | Size | 2px |
68+
| `--pfe-theme--surface--border-width` | Size | 1px |
69+
| `--pfe-theme--surface--border-width--heavy` | Size | 4px |
70+
| `--pfe-theme--surface--border-style` | Border settings | solid |
71+
| `--pfe-theme--surface--border-radius` | Size | 3px |
72+
| `--pfe-theme--surface--border--lightest` | Color | <span class="color-preview" style="--bg:#b5b5b5"></span> #b5b5b5 |
73+
| `--pfe-theme--surface--border--lighter` | Color | <span class="color-preview" style="--bg:#b5b5b5"></span> #b5b5b5 |
74+
| `--pfe-theme--surface--border` | Color | <span class="color-preview" style="--bg:#d2d2d2"></span> #d2d2d2 |
75+
| `--pfe-theme--surface--border--darker` | Color | <span class="color-preview" style="--bg:#dfdfdf"></span> #dfdfdf |
76+
| `--pfe-theme--surface--border--darkest` | Color | <span class="color-preview" style="--bg:#a8a8a8"></span> #a8a8a8 |
77+
| `--pfe-theme--container-spacer` | Size | 16px |
78+
| `--pfe-theme--container-padding` | Size | 16px |
79+
| `--pfe-theme--content-spacer` | Size | 24px |
80+
| `--pfe-theme--animation-timing` | Animation settings | cubic-bezier(0.465, 0.183, 0.153, 0.946) |
81+
| `--pfe-theme--box-shadow--sm` | Box shadow | 0 pfe-size-prem(1) pfe-size-prem(2) 0 rgba(19, 19, 19, 0.2) |
82+
| `--pfe-theme--box-shadow--md` | Box shadow | var(--pfe-theme--box-shadow--md, 0 0.125rem 0.0625rem 0.0625rem rgba(19, 19, 19, 0.12), 0 0.25rem 0.6875rem 0.375rem rgba(19, 19, 19, 0.05)) |
83+
| `--pfe-theme--box-shadow--lg` | Box shadow | var(--pfe-theme--box-shadow--lg, 0 0.1875rem 0.4375rem 0.1875rem rgba(19, 19, 19, 0.13), 0 0.6875rem 1.5rem 1rem rgba(19, 19, 19, 0.12)) |
84+
| `--pfe-theme--box-shadow--inset` | Box shadow | var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #f3f3f3) |
85+
| `--pfe-theme--zindex--modal` | Number | 99 |
86+
| `--pfe-theme--zindex--navigation` | Number | 98 |
87+
| `--pfe-theme--zindex--content` | Number | 0 |
88+
| `--pfe-theme--font-size--heading--alpha` | Size | 32px |
89+
| `--pfe-theme--font-size--heading--beta` | Size | 24px |
90+
| `--pfe-theme--font-size--heading--gamma` | Size | 21px |
91+
| `--pfe-theme--font-size--heading--delta` | Size | 18px |
92+
| `--pfe-theme--font-size--heading--epsilon` | Size | 16px |
93+
| `--pfe-theme--font-size--heading--zeta` | Size | 14px |
94+
| `--pfe-theme--font-size` | Size | 16px |
95+
| `--pfe-theme--line-height` | Line-height | 1.5 |
96+
| `--pfe-theme--font-weight--light` | Font weight | 300 |
97+
| `--pfe-theme--font-weight--normal` | Font weight | 500 |
98+
| `--pfe-theme--font-weight--semi-bold` | Font weight | 600 |
99+
| `--pfe-theme--font-weight--bold` | Font weight | 700 |
100+
| `--pfe-theme--font-family` | Font | "Overpass", Overpass, Helvetica, helvetica, arial, sans-serif |
101+
| `--pfe-theme--font-family--heading` | Font | "Overpass", Overpass, Helvetica, helvetica, arial, sans-serif |
102+
| `--pfe-theme--font-family--code` | Font | "Overpass Mono", Consolas, Monaco, 'Andale Mono', monospace |
103+
| `--pfe-theme--color--text` | Color | <span class="color-preview" style="--bg:#333333"></span> #333333 |
104+
| `--pfe-theme--color--text--on-dark` | Color | <span class="color-preview" style="--bg:#fff"></span> #fff |
105+
| `--pfe-theme--color--text--on-saturated` | Color | <span class="color-preview" style="--bg:#eee"></span> #eee |
106+
| `--pfe-theme--color--link` | Color | <span class="color-preview" style="--bg:#0066cc"></span> #0066cc |
107+
| `--pfe-theme--color--link--hover` | Color | <span class="color-preview" style="--bg:#004080"></span> #004080 |
108+
| `--pfe-theme--color--link--focus` | Color | <span class="color-preview" style="--bg:#004080"></span> #004080 |
109+
| `--pfe-theme--color--link--visited` | Color | <span class="color-preview" style="--bg:#0066cc"></span> #0066cc |
110+
| `--pfe-theme--color--link--on-dark` | Color | <span class="color-preview" style="--bg:#73bcf7"></span> #73bcf7 |
111+
| `--pfe-theme--color--link--hover--on-dark` | Color | <span class="color-preview" style="--bg:#2b9af3"></span> #2b9af3 |
112+
| `--pfe-theme--color--link--focus--on-dark` | Color | <span class="color-preview" style="--bg:#2b9af3"></span> #2b9af3 |
113+
| `--pfe-theme--color--link--visited--on-dark` | Color | <span class="color-preview" style="--bg:#73bcf7"></span> #73bcf7 |
114+
| `--pfe-theme--color--link--on-saturated` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
115+
| `--pfe-theme--color--link--hover--on-saturated` | Color | <span class="color-preview" style="--bg:#d2d3d5"></span> #d2d3d5 |
116+
| `--pfe-theme--color--link--focus--on-saturated` | Color | <span class="color-preview" style="--bg:#d2d3d5"></span> #d2d3d5 |
117+
| `--pfe-theme--color--link--visited--on-saturated` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
118+
| `--pfe-theme--link-decoration` | Text decoration | none |
119+
| `--pfe-theme--link-decoration--hover` | Text decoration | underline |
120+
| `--pfe-theme--link-decoration--focus` | Text decoration | underline |
121+
| `--pfe-theme--link-decoration--visited` | Text decoration | none |
122+
| `--pfe-theme--link-decoration--on-dark` | Text decoration | none |
123+
| `--pfe-theme--link-decoration--hover--on-dark` | Text decoration | underline |
124+
| `--pfe-theme--link-decoration--focus--on-dark` | Text decoration | underline |
125+
| `--pfe-theme--link-decoration--visited--on-dark` | Text decoration | none |
126+
| `--pfe-theme--link-decoration--on-saturated` | Text decoration | underline |
127+
| `--pfe-theme--link-decoration--hover--on-saturated` | Text decoration | underline |
128+
| `--pfe-theme--link-decoration--focus--on-saturated` | Text decoration | underline |
129+
| `--pfe-theme--link-decoration--visited--on-saturated` | Text decoration | underline |
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
+++
2+
title = "Colors"
3+
description = ""
4+
weight = 3
5+
draft = false
6+
bref = ""
7+
toc = true
8+
menu = "theme"
9+
tags = [ "theme" ]
10+
+++
11+
12+
13+
*[Skip to this page](/theme/_2_theme-palette/) if you are looking for a list of all the system variables.*
14+
15+
16+
# Color Theory
17+
18+
19+
## Text & links
20+
21+
Text and links are the most fundamental pieces of any web property, so they have their own variables aside from other UI elements. They also respond to context, such as a bit of text in a dark gray card would need to change to white. Or a link in a dark gray card would need to become a lighter shade of blue. Here are a few examples:
22+
23+
```
24+
--pfe-theme--color--text: #151515;
25+
--pfe-theme--color--text--on-saturated: #eee;
26+
--pfe-theme--color--link: #0066cc;
27+
--pfe-theme--color--link--hover: #004080;
28+
--pfe-theme--color--link--focus--on-dark: #2b9af3;
29+
--pfe-theme--color--link--visited--on-saturated: #ffffff;
30+
```
31+
32+
## UI Colors
33+
34+
A user interface uses color to convey:
35+
36+
- **Feedback**: Error and success states
37+
- **Information**: Charts, graphs, and wayfinding elements
38+
- **Hierarchy**: Showing structured order through color and typography
39+
40+
We've exposed 3 color variants for this design system to represent your brand:
41+
42+
- Base
43+
- Complement
44+
- Accent
45+
46+
These colors are used throughout PatternFly Elements, but **accent is the color which should stand out the most**. For example, if your brand colors are navy, orange, and medium gray, you'll want to set orange as the accent color. You'll see it appear on primary level call-to-action buttons and other elements that need to have more weight in the visual heirarchy of the page.
47+
48+
If you are overriding these colors, you can do so by setting the CSS variables to have new values in the stylesheet of your page or app, like this:
49+
50+
```css
51+
:root {
52+
--pfe-color--ui-base: #030070;
53+
--pfe-color--ui-base--hover: #010047;
54+
--pfe-color--ui-base--text: #ffffff;
55+
--pfe-color--ui-base--text--hover: #eeeeee;
56+
}
57+
```
58+
59+
UI colors are meant to provide basic colors for other page elements besides links and body text. You may choose to set the value of a link color to something in your brand, but it is not required, and these colors should provide a good user experience.
60+
61+
62+
## Surface Colors
63+
64+
It's also a good idea to choose some neutral colors for general UI backgrounds and borders—usually grays. Surface color encompass any "surface" that are typically part of container-type elements, like cards or bands. These colors should be harmonious with your corporate style guide (if you have one), but they may not necessarily be your company’s primary brand colors.
65+
66+
We've exposed 7 color variants for this design system to represent your brand:
67+
68+
- Lightest
69+
- Lighter
70+
- Base
71+
- Darker
72+
- Darkest
73+
- Complement
74+
- Accent
75+
76+
All components automatically observe and react to the attribute `on` which can equal 1 of 3 possible contexts:
77+
78+
- `light`
79+
- `dark`
80+
- `saturated`
81+
82+
This can be overriden by manually applying the `pfe-theme` attribute with one of the following values:
83+
84+
- `light`
85+
- `dark`
86+
- `saturated`
87+
88+
@TODO
89+
90+
Here's an example of colors from a theme, alongside the named version of the appropriate theme variable.
91+
92+
```css
93+
:root {
94+
--pfe-theme--color--surface--lighter: #f0f0f0;
95+
--pfe-theme--color--surface--lighter--theme: light;
96+
--pfe-theme--color--surface--darkest: #1a1a1a;
97+
--pfe-theme--color--surface--darkest--theme: dark;
98+
--pfe-theme--color--surface--accent: #ee0000;
99+
--pfe-theme--color--surface--accent--theme: saturated;
100+
}
101+
```
102+
103+
104+
## Feedback Colors
105+
106+
And finally, you’ll have colors for states such as error, warning, and success. Group these colors to see how well they work together and refine as needed.
107+
108+
```css
109+
:root {
110+
--pfe-color--feedback--critical: $pfe-color--red-600 !default;
111+
--pfe-color--feedback--critical--lightest: $pfe-color--red-50 !default;
112+
--pfe-color--feedback--critical--darkest: $pfe-color--red-800 !default;
113+
}
114+
```
115+
File renamed without changes.

0 commit comments

Comments
 (0)