Skip to content

Commit 572ea91

Browse files
starryeyez024kylebuch8castastrophe[ Cassondra ]
authored
Theming Update | UI colors should match PF core (remove ui-complement & surface-lighter) (#895)
* Use PF core variable for blue & set ui-accent variable to point to it. Update pfe-tabs to use ui-accent. Change ui-base and ui-complement to be blue * Update import statement, use node-package-sass-importer (thx Kyle & Cassondra!), update accordions to use accent color * Remove ui-complement; use only base (gray) and accent (blue) * Update documentation * Add support for pfe-color=base attribute on default cta * Update to Patternfly version 4.10.31; import scss-variables from PF core, Use primary & secondary PatternFly core colors * update colors in jump links & nav * update ui colors in page-status component * Update gray colors to use PF core grays; update surface map to use lighter gray colors * Fix feedback, badge default colors * Add ui-base + saturated colors; Adjust opacity value to .2 * WIP updating theme-test page Update surface colors, probably need to change base color Adjust card header opacity * revert surface base back to a light color * Adjust band demo to show all surface colors in order; add temporary RH theme for demo purposes * Add text-muted var; move link underlines out of color map; update theme-demo color vars to include the word color like advanced theme; add to theme-test page Add pfe-vars file to demo remaining variables (still doesnt create CSS though) * Add text-muted variable * Update component files; however this is just for demonstration purposes and may be altered when faced with merge conflicts * use PF core red colors * Adjust opacity value per design team feedback * update band demo page to show grid issues at the bottom * Importing using gulp-sass includePaths * Fix dropdown color variable references * fix color name in page-status * Add import statement to fix missing vars error * Remove references to "lighter" in schemas & sass; update default color on pfe icon so that the non circled icon is more visible https://www.evernote.com/l/AA5bX7wjMLFJALJPLyitWAOlFnOkcCXsBLk * Update AT expected colors * Swap surface colors for UI colors on the nav * bring back pfe-color=lighter in card & band, show as deprecated. * Add dark & saturated contexts to default CTA; Move context up above color overrides so color attribute wins * Fix hover/focus state colors * Update more PFE colors to PF core colors * remove interpolation * Update link colors to use lighter more accessible blues * Update elements/pfe-card/src/pfe-card.scss * Update elements/pfe-band/demo/index.html * Var cleanup, add debug mixin * Prettify band demo Co-authored-by: Kyle Buchanan <[email protected]> Co-authored-by: [ Cassondra ] <[email protected]> Co-authored-by: [ Cassondra ] <[email protected]>
1 parent 6ef7f74 commit 572ea91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1612
-935
lines changed

docs/content/theme/color-palette.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ tags = [ "theme" ]
1818

1919
## Text & links
2020

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:
21+
Text and links, being fundamental pieces of any web property, have their own set of variables.
22+
These variables assume a light background by default, assigning typography colors that pass accessibility when placed on white or very light gray contexts. In addition, we provide contextual variables for these typographical elements for when they exist inside a dark or saturated context. Text in a black card for example would need to flip to white to pass accessibility standards while links on a blue or red shade would need to update to white in order to be visible.
23+
24+
You can set the value of these typography color variables to something in your brand palette but be sure to validate them against a [contrast checker](https://webaim.org/resources/contrastchecker/) to ensure they continue to pass accessibility standards when set against your surface or UI palettes. Aim for AAA status if you can! ⭐
25+
26+
Here are a few examples:
2227

2328
```
2429
--pfe-theme--color--text: #151515;
@@ -37,15 +42,16 @@ A user interface uses color to convey:
3742
- **Information**: Charts, graphs, and wayfinding elements
3843
- **Hierarchy**: Showing structured order through color and typography
3944

40-
We've exposed 3 color variants for this design system to represent your brand:
45+
We've exposed 2 UI color variants for the UI elements in the design system to represent your brand:
4146

4247
- Base
43-
- Complement
4448
- Accent
4549

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.
50+
These colors are used throughout PatternFly Elements. **Accent** is the color which should stand out the most. For example, if your brand colors are orange and gray, we recommend you set orange as the accent color. In doing this, that orange will now appear on primary level call-to-action buttons and other elements that need to have more weight in the visual hierarchy of the page.
51+
52+
UI colors are meant to provide basic colors for other page elements besides links and body text.
4753

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:
54+
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. You'll want to override the color itself, but also the corresponding hover variant and text color (that would be used if there was text on top of this color, like a button):
4955

5056
```css
5157
:root {
@@ -56,9 +62,6 @@ If you are overriding these colors, you can do so by setting the CSS variables t
5662
}
5763
```
5864

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-
6265
## Surface Colors
6366

6467
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.
@@ -112,4 +115,3 @@ And finally, you’ll have colors for states such as error, warning, and success
112115
--pfe-color--feedback--critical--darkest: $pfe-color--red-800 !default;
113116
}
114117
```
115-

docs/content/theme/theme-palette.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,19 @@ tags = [ "theme" ]
2525

2626
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.
2727

28+
*If you have the project checked out locally, open up: pfe-styles/_temp/pfe-colors.css*
29+
2830
| Variable name | Type | Project default |
2931
| ------------- | ---------- | --- |
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 |
32+
| `--pfe-theme--color--ui-base` | Color | <span class="color-preview" style="--bg:#737679"></span> #737679 |
33+
| `--pfe-theme--color--ui-base--hover` | Color | <span class="color-preview" style="--bg:#4f5255"></span> #4f5255 |
34+
| `--pfe-theme--color--ui-base--focus` | Color | <span class="color-preview" style="--bg:#4f5255"></span> #4f5255 |
3335
| `--pfe-theme--color--ui-base--text` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
3436
| `--pfe-theme--color--ui-base--text--hover` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
3537
| `--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 |
38+
| `--pfe-theme--color--ui-accent` | Color | <span class="color-preview" style="--bg:#06c"></span> #06c |
39+
| `--pfe-theme--color--ui-accent--hover` | Color | <span class="color-preview" style="--bg:#003366"></span> #003366 |
40+
| `--pfe-theme--color--ui-accent--focus` | Color | <span class="color-preview" style="--bg:#003366"></span> #003366 |
4341
| `--pfe-theme--color--ui-accent--text` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
4442
| `--pfe-theme--color--ui-accent--text--hover` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
4543
| `--pfe-theme--color--ui-accent--text--focus` | Color | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |

elements/pfe-accordion/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
.custom-styles pfe-accordion {
8686
--pfe-accordion--accent: #fff;
87-
--pfe-theme--color--ui-base: #444;
87+
--pfe-theme--color--ui-accent: #ad41ad;
8888
}
8989

9090
.custom-styles h2 {

elements/pfe-accordion/src/pfe-accordion-header.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@include browser-query(ie11) {
2424
padding: 16px 24px;
2525
&:hover {
26-
border-left-color: pfe-fetch(ui-base);
26+
border-left-color: pfe-fetch(ui-accent);
2727
}
2828
}
2929

@@ -32,7 +32,7 @@
3232
@include pfe-print-local($accordion);
3333
@include browser-query(ie11) {
3434
border-bottom-width: 0;
35-
border-left-color: pfe-fetch(ui-base);
35+
border-left-color: pfe-fetch(ui-accent);
3636
border-right-color: pfe-fetch(surface--border);
3737
}
3838
}

elements/pfe-accordion/src/pfe-accordion-panel.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
@include pfe-collapsible($state: open);
5050
@include browser-query(ie11) {
5151
border-top-width: 0;
52-
border-left-color: pfe-var(ui-base);
52+
border-left-color: pfe-var(ui-accent);
5353
border-right-color: pfe-var(surface--border);
5454
}
5555
}

elements/pfe-autocomplete/src/pfe-autocomplete.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $LOCAL-VARIABLES: (
6868
}
6969

7070
button {
71-
color: pfe-var(ui-complement);
71+
color: pfe-var(ui-base);
7272
background-color: transparent;
7373
border: none;
7474
position: absolute;
@@ -82,7 +82,7 @@ button {
8282
margin: 2px 1px;
8383
background-color: pfe-var(surface--lightest);
8484
&:hover {
85-
color: pfe-var(ui-complement);
85+
color: pfe-var(ui-base);
8686
}
8787
svg {
8888
width: 12px;

0 commit comments

Comments
 (0)