Skip to content

Commit 516d9e8

Browse files
alazzara[ Cassondra ]castastrophestarryeyez024
authored
feat: pfe-tabs style updates (#948)
* feat Add support for empty local variables * feat CHANGELOG udpate * feat Working through local variable updates * feat Working through challenges moving to empty variables in the component mixins * feat Applying empty local variables * feat Fix typo in band story * feat Add some more documentation to the sass * feat Update local function references and update toast for local vars * feat Remove commented out variable print * feat Update modal * feat Update tabs * feat Add theming to page-status * feat Adjusting implementation on the accordion * Simplify functions! * feat Fix improperly escaped parens * feat Update documentation * feat Update documentation with best practices * feat Revert accidental updates to variable names * feat Clean up unnecessary interpolation * feat Remove unnecessary interpolation from autocomplete * feat Remove unneeded interpolation from avatar, badge, and band * feat Cleaning up references and interpolation in band, card * Apply suggestions from code review * feat Fix compile error * feat Revert doc updates, new PR opened for these * feat Update changelog, remove doc update * feat Working through dropdown updates * feat Fix a find-replace error in doc for pfe-surface * feat Rename and remove alias for set local function * feat Abstract repo variable and local value * feat Ensure all pfe prefixes reference repo var * feat Replace repo variable across the project * feat dropdown items using new syntax now * feat Jump links still broken but bringing items together to make styling easier * feat Add empty local variable updates to pfe-jump-links * feat Fix band local theme ref * feat Remove change to jump links template * Remove dupe from changelog * feat Use the pfe-print-local tool in accordion * feat Apply updated format to pfe-cta * feat Update modal * feat Adjust navigation and select components for new empty loca vars * feat Add context to broadcasted output * feat Clean up empty map * feat git checkout origin/master -- elements/**/package-lock.json * feat Pull out package-lock updates * feat Adjust maxWidth on cta * feat Fix self-referencing broadcast variables * US251839 tab style updates * Update elements/pfe-sass/functions/_custom-properties.scss Co-authored-by: Kendall Totten <[email protected]> * updates from pair programming session * sass updates * some code clean up * fix tab shift when tab goes from not active to active * feat Remove interpolation from pfe-toast and revert variablizing --pfe on custom props * add ie11 fixes * some code clean up * some code clean up * feat Update generator notes and docs; add backwards support in avatar * some code clean up * feat Add comments to self-referential maps * feat Navigation item, remove interpolation and commented out code * feat Update a few merges to deep merge with LOCAL-VARIABLES maps; add comments * feat Move new maps to shared assets file for readability * feat Backwards compatibility for pfe-dropdown * feat Fallback for pfe-dropdown property naming * feat Additional fallback styles for variable naming * dark theme tweaks * Updates from design review * updates from design review * attempt at fix for focus state for tabs with sudo element * Move styles for extra borders on vertical wind variant into pfe-tabs template * dark vertical styling * style clean up * dark earth style update * updeates from code review * fix for vertical earth tabs on dark * add saturated band to pfe tabs demo page * updates from CR * some CR changes * add missed tab padding updates * saturate hover color fix * remove package-lock files * Update CHANGELOG-prerelease.md * Update CHANGELOG-prerelease.md * Removing unrelated files from latest merge with master * Assist with interpolation clean-up * updates from code review * changes for red hat theme tab font size * add fix for earth vertical tab alignment and earth saturated font color * style fixes * update ie11 style * fix active state * fix default dark wind color * ie11 fixes * pfe-tabs fork: Debugging tools, var name updates + backwards compatibility (#1005) * Add back debugging mixin to print local variables for testing. Update names of variables in local map for BEM & consistency, move old vars to backwards-compatibility map. * Simplify border properties; use regular css properties instead of redefining local vars as often. Add ui-border vars. * Add comment to new mixin. Add links to pfe-tab demo to ensure tab index works in tab panels. Run prettier on the pfe-tab sass. Clean up ie11 styles, remove magic numbers & replace with pfe-fetch. Update tab panel colors & border placement per feedback from Corey. Add support for padding adjustments to panel per breakpoint; change tab width. Update demo file so its full width to demonstrate spacing. Restore tab and panel variable regions. Add weird background colors to demo so you can see where tabs have background colors. Restore use of surface--border var, delete ui-border * add inset to earth variant to prevent weird border visuals & match pfe core * remove commented out lines; deprecate unusable padding variables in parent file * Update debug mixin to lean on pfe-print-local mixin #singlesourceoftruth Rearrange & de-dupe selectors in pfe-tab sass file Fix vertical variants on mobile * Add broadcast variables to tab panels; Remove ie11 overrides from pfe-tab * Update elements/pfe-tabs/src/pfe-tab.scss Co-authored-by: [ Cassondra ] <[email protected]> * Remove debugging code, cleanup fallbacks * move fallbacks to local vars map * move fallbacks to local vars map * Update backwards compatibility map & references in file to use new variables * Update CHANGELOG-prerelease.md * Fix text colors * Catch up with the latest colors * Fix hover state border jumpiness * remove nth child extra specificity, fix border width on vertical earth * reduce duplicate selectors * remove @at-root * removed unused var * tidy * use text--on-dark instead of surface--lightest for typography * Move color into .pfe > * for specificity, run prettier, add color & color--focus vars to dark / saturated sets * remove ie11 override * Fix the dang first/last borders on vertical earth variants * formatting * Tidy @at-root * add interpolation for local var value * remove debug * resolve jumpy borders on vertical earth variants * revert demo css Co-authored-by: [ Cassondra ] <[email protected]> Co-authored-by: [ Cassondra ] <[email protected]> Co-authored-by: Kendall Totten <[email protected]>
1 parent 65a1029 commit 516d9e8

File tree

9 files changed

+664
-341
lines changed

9 files changed

+664
-341
lines changed

CHANGELOG-prerelease.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [6ef7f74](https://github.com/patternfly/patternfly-elements/commit/6ef7f74bfe22b259373f3485a46b21f37aa7196e) fix: pfe-accordion border styles (#1002)
44
- [572ea91](https://github.com/patternfly/patternfly-elements/commit/572ea9133373ab91e99c2fc6e67aa6fb1a0d1ed0) feat: UI colors should match PF core (#895)
5+
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: pfe-tab style updates (#814)
56

67
## Prerelease 53 ( 2020-07-21 )
78

elements/pfe-sass/maps/_colors.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ $pfe-colors: (
1414
link--focus: $pf-color-blue-500,
1515

1616
text--on-dark: $pf-color-white,
17-
text--muted--on-dark: $pf-color-white,
17+
text--muted--on-dark: $pf-color-black-300,
1818
link--on-dark: $pf-color-blue-200,
1919
link--visited--on-dark: $pf-color-blue-100,
2020
link--hover--on-dark: $pf-color-blue-100,
2121
link--focus--on-dark: $pf-color-blue-100,
2222

2323
text--on-saturated: $pf-color-white,
24-
text--muted--on-saturated: $pf-color-white,
24+
text--muted--on-saturated: $pf-color-black-300,
2525
link--on-saturated: $pf-color-white,
2626
link--visited--on-saturated: $pf-color-purple-400,
2727
link--hover--on-saturated: $pf-color-black-100,
@@ -154,4 +154,5 @@ $pfe-colors: (
154154
feedback--default--darkest: $pf-color-black-800,
155155

156156
overlay: rgba($pf-color-black-900, .5)
157-
);
157+
);
158+

elements/pfe-sass/maps/_general.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ $pfe-vars: (
2626
surface--border-width--heavy: 4px,
2727
surface--border-style: solid,
2828
surface--border-radius: 3px,
29+
surface--border-width--active: 3px,
2930

3031
icon-size: 1em,
31-
32+
3233
ui--element--size: 20px,
3334

3435
ui--border-width: 1px,
36+
ui--border-width--active: 3px,
3537
ui--border-style: solid,
3638
ui--border-radius: 2px,
3739

elements/pfe-tabs/demo/demo.css

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,34 @@ section.pfe-l-grid {
5757
.example>h2 {
5858
text-align: right;
5959
}
60+
section>h2 {
61+
margin-top: 2em;
62+
}
6063

6164
.subheading {
6265
margin: 0;
6366
font-size: 18px;
6467
font-weight: bold;
6568
font-family: "Arial";
6669
}
67-
70+
.inner {
71+
margin: auto;
72+
max-width:1140px;
73+
padding: 50px 0;
74+
}
75+
.light-background {
76+
background-color: rgb(252, 250, 244);
77+
--theme: light;
78+
}
6879
.dark-background {
69-
background-color: #151515;
80+
background-color: #383333;
7081
--theme: dark;
7182
}
83+
.saturated-background {
84+
background-color: teal;
85+
--theme: saturated;
86+
}
87+
7288

7389
.floating-card {
7490
float: left;
@@ -123,4 +139,4 @@ button.form-ui {
123139
height: 2em;
124140
font-size: 1em;
125141
padding: 2px 5px;
126-
}
142+
}

elements/pfe-tabs/demo/index.html

Lines changed: 270 additions & 112 deletions
Large diffs are not rendered by default.

elements/pfe-tabs/src/pfe-tab-panel.scss

Lines changed: 73 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@
22

33
$LOCAL: tabs;
44

5-
$LOCAL-VARIABLES: (
6-
focus: pfe-var(link)
7-
);
5+
$LOCAL-VARIABLES: (focus: pfe-var(link),
6+
panel: ( // to avoid collisions with tab header
7+
BackgroundColor: transparent,
8+
Padding: pfe-var(container-spacer),
9+
BorderTop: 0,
10+
BorderRight: 0,
11+
BorderBottom: 0,
12+
BorderLeft: 0,
13+
));
14+
15+
////////////////////////////////
816

917
:host {
10-
1118
display: block;
19+
color: pfe-broadcasted(text);
1220

1321
@at-root #{&}(:focus) {
1422
outline: none;
1523
}
1624

17-
::slotted(*) {
18-
color: #{pfe-broadcasted(text)};
19-
}
20-
2125
[tabindex] {
2226
display: flex;
2327
height: 100%;
@@ -26,69 +30,105 @@ $LOCAL-VARIABLES: (
2630
.container {
2731
margin: 0;
2832
width: 100%;
29-
padding: #{pfe-local($cssvar: Padding, $region: panel, $fallback: #{pfe-var(container-spacer)} 0)};
33+
background-color: pfe-local(BackgroundColor, $region: panel);
34+
border-top: pfe-local(BorderTop, $region: panel);
35+
border-right: pfe-local(BorderRight, $region: panel);
36+
border-bottom: pfe-local(BorderBottom, $region: panel);
37+
border-left: pfe-local(BorderLeft, $region: panel);
38+
39+
padding: pfe-local(Padding, $region: panel); //16px
3040

31-
border-top: #{pfe-local(BorderTop, 0, $region: panel)};
32-
border-right: #{pfe-local(BorderRight, 0, $region: panel)};
33-
border-bottom: #{pfe-local(BorderBottom, 0, $region: panel)};
34-
border-left: #{pfe-local(BorderLeft, 0, $region: panel)};
41+
@media screen and (min-width: pfe-breakpoint(md)) {
42+
padding: calc(#{pfe-local(Padding, $region: panel)} * 2);
43+
}
44+
45+
@media screen and (min-width: pfe-breakpoint(lg)) {
46+
padding: calc(#{pfe-local(Padding, $region: panel)} * 3);
47+
}
48+
49+
@media screen and (min-width: pfe-breakpoint(xl)) {
50+
padding: calc(#{pfe-local(Padding, $region: panel)} * 4);
51+
}
3552

3653
@include pfe-clearfix;
54+
3755
@include browser-query(ie11) {
3856
padding: 1em;
39-
background-color: #{map-get($pfe-colors, surface--lightest)} !important;
40-
color: #{pfe-var(text)} !important;
57+
background-color: pfe-fetch(surface--lightest) !important;
58+
color: pfe-fetch(text) !important;
4159
}
4260
}
4361
}
4462

63+
:host([hidden]) {
64+
display: none;
65+
}
66+
4567
/// ===========================================================================
4668
/// HORIZONTAL
4769
/// ===========================================================================
4870
:host([pfe-variant="earth"]) {
49-
--pfe-tabs__panel--Padding: calc(#{pfe-var(container-spacer)} * 2);
50-
51-
--pfe-tabs__panel--BorderRight: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-var(surface--border)};
52-
--pfe-tabs__panel--BorderBottom: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-var(surface--border)};
53-
--pfe-tabs__panel--BorderLeft: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-var(surface--border)};
54-
5571

5672
@include browser-query(ie11) {
5773
.container {
74+
background-color: pfe-fetch(surface--lightest);
5875
padding: 1em;
59-
border-right: 1px solid #{pfe-var(surface--border)};
60-
border-bottom: 1px solid #{pfe-var(surface--border)};
61-
border-left: 1px solid #{pfe-var(surface--border)};
76+
border-right: 1px solid pfe-fetch(surface--border);
77+
border-bottom: 1px solid pfe-fetch(surface--border);
78+
border-left: 1px solid pfe-fetch(surface--border);
6279
}
6380
}
6481
}
6582

83+
6684
/// ===========================================================================
6785
/// VERTICAL
6886
/// ===========================================================================
87+
6988
@media screen and (min-width: #{pfe-breakpoint(md)}) {
7089
:host([pfe-variant="wind"][vertical]) {
71-
--pfe-tabs__panel--Padding: #{pfe-var(container-spacer)} 0 #{pfe-var(container-spacer)} calc(#{pfe-var(container-spacer)} * 2);
90+
padding-top: 0;
91+
padding-bottom: 0;
92+
padding-right: 0;
7293

7394
@include browser-query(ie11) {
7495
.container {
7596
padding: 1em 0 1em 2em;
7697
}
7798
}
78-
}
99+
}
79100

80-
:host([pfe-variant="earth"][vertical]) {
81-
--pfe-tabs__panel--BorderTop: #{pfe-var(ui--border-width)} #{pfe-var(ui--border-style)} #{pfe-var(surface--border)};
101+
:host([pfe-variant="earth"][vertical]) {
102+
border-top: 0px;
103+
border-left: pfe-var(ui--border-width) pfe-var(ui--border-style) pfe-var(surface--border);
82104
height: 100%;
83-
105+
84106
@include browser-query(ie11) {
85107
.container {
86-
border-top: 1px solid #{pfe-var(surface--border)};
108+
border-top: 1px solid pfe-fetch(surface--border);
87109
}
88110
}
89-
}
111+
}
90112
}
91113

92-
:host([hidden]) {
93-
display: none;
114+
/// ===========================================================================
115+
/// CONTEXTS: DARK & SATURATED
116+
/// ===========================================================================
117+
/// In dark & saturated contexts, we override the local color vars
118+
:host([pfe-variant="earth"][on="dark"]) {
119+
--pfe-tabs__panel--BackgroundColor: #{pfe-var(surface--darkest)};
120+
@include pfe-set-broadcast-theme(dark);
121+
}
122+
123+
:host([pfe-variant="earth"][on="saturated"]) {
124+
--pfe-tabs__panel--BackgroundColor: #{pfe-var(surface--lightest)};
125+
@include pfe-set-broadcast-theme(light);
94126
}
127+
128+
:host([pfe-variant="wind"][on="saturated"]) {
129+
@include pfe-set-broadcast-theme(saturated);
130+
}
131+
132+
:host([pfe-variant="wind"][on="dark"]) {
133+
@include pfe-set-broadcast-theme(dark);
134+
}

0 commit comments

Comments
 (0)