Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): fix dark theme bugs #5535

Merged
merged 6 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/patternfly/assets/images/pf_logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/patternfly/base/themes/dark/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
--#{$pf-global}--active-color--100: #{$pf-v5-global--active-color--100};
--#{$pf-global}--primary-color--100: #{$pf-v5-global--primary-color--100};
--#{$pf-global}--primary-color--300: #{$pf-v5-global--primary-color--300};
--#{$pf-global}--primary-color--400: #{$pf-v5-global--primary-color--400};
--#{$pf-global}--custom-color--200: #{$pf-v5-global--custom-color--200};
--#{$pf-global}--success-color--100: #{$pf-v5-global--success-color--100};
--#{$pf-global}--warning-color--100: #{$pf-v5-global--warning-color--100};
--#{$pf-global}--warning-color--200: #{$pf-v5-global--warning-color--200};
Expand Down
14 changes: 7 additions & 7 deletions src/patternfly/components/Alert/themes/dark/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

@mixin pf-v5-theme-dark-alert() {
.#{$alert} {
--#{$alert}--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}__title--Color: var(--#{$pf-global}--custom-color--200);
--#{$alert}--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$alert}--m-custom__title--Color: var(--#{$pf-global}--custom-color--200);
--#{$alert}--m-success__title--Color: var(--#{$pf-global}--success-color--100);
--#{$alert}--m-danger__title--Color: var(--#{$pf-global}--danger-color--100);
--#{$alert}--m-warning__title--Color: var(--#{$pf-global}--warning-color--100);
--#{$alert}--m-info__title--Color: var(--#{$pf-global}--info-color--100);
--#{$alert}--m-inline--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}--m-inline--m-success--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}--m-inline--m-danger--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}--m-inline--m-warning--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}--m-inline--m-info--BackgroundColor: var(--#{$pf-global}--palette--black-600);
--#{$alert}--m-inline--m-custom--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$alert}--m-inline--m-success--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$alert}--m-inline--m-danger--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$alert}--m-inline--m-warning--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$alert}--m-inline--m-info--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
}
}
1 change: 1 addition & 0 deletions src/patternfly/components/AppLauncher/app-launcher.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
font-weight: var(--#{$app-launcher}__menu-item--FontWeight);
color: var(--#{$app-launcher}__menu-item--Color);
white-space: nowrap;
background: none;
border: 0;

&:hover,
Expand Down
1 change: 1 addition & 0 deletions src/patternfly/components/Badge/themes/dark/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@mixin pf-v5-theme-dark-badge() {
.#{$badge} {
--#{$badge}--m-read--BackgroundColor: var(--#{$pf-global}--palette--black-500);
--#{$badge}--m-unread--Color: var(--#{$pf-global}--primary-color--400);
--#{$badge}--m-unread--BackgroundColor: var(--#{$pf-global}--primary-color--300);
}
}
10 changes: 5 additions & 5 deletions src/patternfly/components/Banner/banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

// modifier variables
--#{$banner}--m-blue--BackgroundColor: var(--#{$pf-global}--palette--blue-200);
--#{$banner}--m-red--BackgroundColor: var(--#{$pf-global}--palette--red-100);
--#{$banner}--m-green--BackgroundColor: var(--#{$pf-global}--palette--green-500);
--#{$banner}--m-gold--BackgroundColor: var(--#{$pf-global}--palette--gold-400);
--#{$banner}--m-red--BackgroundColor: var(--#{$pf-global}--danger-color--100);
--#{$banner}--m-green--BackgroundColor: var(--#{$pf-global}--success-color--100);
--#{$banner}--m-gold--BackgroundColor: var(--#{$pf-global}--warning-color--100);
--#{$banner}--m-sticky--ZIndex: var(--#{$pf-global}--ZIndex--md);
--#{$banner}--m-sticky--BoxShadow: var(--#{$pf-global}--BoxShadow--md-bottom);

Expand All @@ -43,7 +43,7 @@
background-color: var(--#{$banner}--BackgroundColor);

&.pf-m-blue {
@include pf-v5-t-light;
@include pf-v5-t-light(false);

--#{$banner}--BackgroundColor: var(--#{$banner}--m-blue--BackgroundColor);
}
Expand All @@ -57,7 +57,7 @@
}

&.pf-m-gold {
@include pf-v5-t-light;
@include pf-v5-t-light(false);

--#{$banner}--BackgroundColor: var(--#{$banner}--m-gold--BackgroundColor);
}
Expand Down
8 changes: 2 additions & 6 deletions src/patternfly/components/Banner/themes/dark/banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

@mixin pf-v5-theme-dark-banner() {
.#{$banner} {
&.pf-m-info,
&.pf-m-blue,
&.pf-m-danger,
&.pf-m-red,
&.pf-m-success,
&.pf-m-green,
&.pf-m-warning,
&.pf-m-gold {
color: var(--#{$pf-global}--palette--black-900);
--#{$banner}--Color: var(--#{$pf-global}--palette--black-900);
}

@include pf-v5-theme-dark--t-dark;
@include pf-v5-theme-dark--t-dark(false);
}
}
2 changes: 2 additions & 0 deletions src/patternfly/components/Button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
--#{$button}--m-link--active--BackgroundColor: transparent;
--#{$button}--m-link--active--Color: var(--#{$pf-global}--link--Color--hover);
--#{$button}--m-link--disabled--BackgroundColor: transparent;
--#{$button}--m-link--disabled--Color: var(--#{$pf-global}--disabled-color--100);
--#{$button}--m-link--m-inline--FontSize: inherit;
--#{$button}--m-link--m-inline--hover--TextDecoration: var(--#{$pf-global}--link--TextDecoration--hover);
--#{$button}--m-link--m-inline--hover--Color: var(--#{$pf-global}--link--Color--hover);
Expand Down Expand Up @@ -352,6 +353,7 @@
// Link buttons
&.pf-m-link {
--#{$button}--disabled--BackgroundColor: var(--#{$button}--m-link--disabled--BackgroundColor);
--#{$button}--disabled--Color: var(--#{$button}--m-link--disabled--Color);

color: var(--#{$button}--m-link--Color);
background-color: var(--#{$button}--m-link--BackgroundColor);
Expand Down
6 changes: 4 additions & 2 deletions src/patternfly/components/Button/themes/dark/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
@mixin pf-v5-theme-dark-button() {
.#{$button} {
--#{$button}--disabled--Color: var(--#{$pf-global}--disabled-color--300);
--#{$button}--m-primary--BackgroundColor: var(--#{$pf-global}--primary-color--300); // should blue-400 be a primary-color?
--#{$button}--m-primary--BackgroundColor: var(--#{$pf-global}--primary-color--300);
--#{$button}--m-primary--Color: var(--#{$pf-global}--primary-color--400);
--#{$button}--m-tertiary--after--BorderColor: var(--#{$pf-global}--BorderColor--100);
--#{$button}--m-tertiary--Color: var(--#{$pf-global}--palette--black-100); // global variable for this?
--#{$button}--m-tertiary--Color: var(--#{$pf-global}--palette--black-100);
--#{$button}--m-tertiary--hover--after--BorderColor: var(--#{$pf-global}--BorderColor--100);
--#{$button}--m-tertiary--hover--Color: var(--#{$pf-global}--palette--black-100);
--#{$button}--m-tertiary--focus--after--BorderColor: var(--#{$pf-global}--BorderColor--100);
Expand All @@ -23,6 +24,7 @@
--#{$button}--m-danger--hover--Color: var(--#{$pf-global}--palette--black-900);
--#{$button}--m-danger--focus--Color: var(--#{$pf-global}--palette--black-900);
--#{$button}--m-danger--active--Color: var(--#{$pf-global}--palette--black-900);
--#{$button}--m-link--disabled--Color: var(--#{$pf-global}--disabled-color--100);
--#{$button}--m-control--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
--#{$button}--m-control--hover--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
--#{$button}--m-control--active--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
Expand Down
6 changes: 1 addition & 5 deletions src/patternfly/components/CalendarMonth/calendar-month.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// @debug $calendar-month; // check your variable names located in src/patternfly/sass-utilities/component-namespaces.scss

.#{$calendar-month} {
--#{$calendar-month}--BackgroundColor: var(--#{$pf-global}--BackgroundColor--100);
--#{$calendar-month}--PaddingTop: var(--#{$pf-global}--spacer--lg);
--#{$calendar-month}--PaddingRight: var(--#{$pf-global}--spacer--lg);
--#{$calendar-month}--PaddingBottom: var(--#{$pf-global}--spacer--md);
Expand Down Expand Up @@ -49,7 +46,7 @@
--#{$calendar-month}__dates-cell--m-in-range--m-end-range--before--Right: 50%;
--#{$calendar-month}__dates-cell--m-in-range__date--hover--BackgroundColor: var(--#{$pf-global}--palette--blue-100);
--#{$calendar-month}__dates-cell--m-in-range__date--focus--BackgroundColor: var(--#{$pf-global}--palette--blue-100);
--#{$calendar-month}__dates-cell--m-adjacent-month__date--Color: var(--#{$pf-global}--disabled-color--100);
--#{$calendar-month}__dates-cell--m-adjacent-month__date--Color: var(--#{$pf-global}--Color--200);

// date button
--#{$calendar-month}__date--Width: 4ch;
Expand All @@ -71,7 +68,6 @@
flex-direction: column;
padding: var(--#{$calendar-month}--PaddingTop) var(--#{$calendar-month}--PaddingRight) var(--#{$calendar-month}--PaddingBottom) var(--#{$calendar-month}--PaddingLeft);
font-size: var(--#{$calendar-month}--FontSize);
background-color: var(--#{$calendar-month}--BackgroundColor);
}

.#{$calendar-month}__header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.#{$calendar-month} {
--#{$calendar-month}__dates-cell--m-current__date--BackgroundColor: var(--#{$pf-global}--palette--black-500);
--#{$calendar-month}__dates-cell--m-selected__date--BackgroundColor: var(--#{$pf-global}--primary-color--300);
--#{$calendar-month}__dates-cell--m-selected__date--Color: var(--#{$pf-global}--primary-color--400);
--#{$calendar-month}__dates-cell--m-selected__date--hover--BackgroundColor: var(--#{$pf-global}--palette--black-900);
--#{$calendar-month}__dates-cell--m-selected__date--focus--BackgroundColor: var(--#{$pf-global}--palette--blue-400);
--#{$calendar-month}__dates-cell--m-in-range--before--BackgroundColor: var(--#{$pf-global}--BackgroundColor--200);
Expand All @@ -26,6 +27,7 @@
--#{$calendar-month}__date--after--BorderColor: var(--#{$pf-global}--active-color--100);
--#{$calendar-month}__date--after--BorderWidth: var(--#{$pf-global}--BorderWidth--sm);
--#{$calendar-month}__date--BackgroundColor: var(--#{$pf-global}--primary-color--300);
--#{$calendar-month}__date--Color: var(--#{$pf-global}--primary-color--400);
}
}
}
53 changes: 36 additions & 17 deletions src/patternfly/components/DragDrop/drag-drop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,53 @@
}

.#{$droppable} {
$pf-v5-global--BackgroundColor--100: #fff;
$pf-v5-c-droppable--m-dragging--after--BackgroundColor: rgba($pf-v5-global--BackgroundColor--100, .6);

--#{$droppable}--m-dragging--after--BackgroundColor: #{$pf-v5-c-droppable--m-dragging--after--BackgroundColor}; // allows for rbga() so we can combine background and border in single element
--#{$droppable}--before--BackgroundColor: transparent;
--#{$droppable}--before--Opacity: 0;
--#{$droppable}--after--BorderWidth: 0;
--#{$droppable}--after--BorderColor: transparent;
--#{$droppable}--m-dragging--before--BackgroundColor: var(--#{$pf-global}--palette--white);
--#{$droppable}--m-dragging--before--Opacity: .6;
--#{$droppable}--m-dragging--after--BorderWidth: var(--#{$pf-global}--BorderWidth--sm);
--#{$droppable}--m-dragging--after--BorderColor: var(--#{$pf-global}--active-color--100);
--#{$droppable}--m-drag-outside--after--BorderColor: var(--#{$pf-global}--danger-color--100);

&.pf-m-dragging {
position: relative;
&::before,
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
pointer-events: none;
content: "";
}

&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
pointer-events: none;
content: "";
}
&::before {
background-color: var(--#{$droppable}--before--BackgroundColor);
opacity: var(--#{$droppable}--before--Opacity);
}

&::after {
background-color: var(--#{$droppable}--m-dragging--after--BackgroundColor);
border: var(--#{$droppable}--m-dragging--after--BorderWidth) solid var(--#{$droppable}--m-dragging--after--BorderColor);
border: var(--#{$droppable}--after--BorderWidth, 0) solid var(--#{$droppable}--after--BorderColor, transparent);
}

&.pf-m-dragging {
--#{$droppable}--before--BackgroundColor: var(--#{$droppable}--m-dragging--before--BackgroundColor);
--#{$droppable}--before--Opacity: var(--#{$droppable}--m-dragging--before--Opacity);
--#{$droppable}--after--BorderWidth: var(--#{$droppable}--m-dragging--after--BorderWidth);
--#{$droppable}--after--BorderColor: var(--#{$droppable}--m-dragging--after--BorderColor);

position: relative;
}

&.pf-m-drag-outside {
--#{$droppable}--m-dragging--after--BorderColor: var(--#{$droppable}--m-drag-outside--after--BorderColor);
}
}

// stylelint-disable no-invalid-position-at-import-rule
@import "themes/dark/drag-drop";

@include pf-v5-theme-dark {
@include pf-v5-theme-dark-drag-drop;
}
7 changes: 7 additions & 0 deletions src/patternfly/components/DragDrop/themes/dark/drag-drop.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "../../../../sass-utilities/themes/dark/all";

@mixin pf-v5-theme-dark-drag-drop() {
.#{$droppable} {
--#{$droppable}--m-dragging--before--Opacity: .2;
}
}
2 changes: 2 additions & 0 deletions src/patternfly/components/Dropdown/themes/dark/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
--#{$dropdown}__toggle--before--BorderBottomColor: var(--#{$pf-global}--BorderColor--400);
--#{$dropdown}__toggle--before--BorderLeftColor: transparent;
--#{$dropdown}__toggle--disabled--BackgroundColor: var(--#{$pf-global}--palette--black-500);
--#{$dropdown}__toggle--m-split-button--m-primary--child--BackgroundColor: var(--#{$pf-global}--primary-color--300);
--#{$dropdown}__toggle--m-primary--BackgroundColor: var(--#{$pf-global}--primary-color--300);
--#{$dropdown}__toggle--m-primary--Color: var(--#{$pf-global}--primary-color--400);
--#{$dropdown}__menu--BackgroundColor: var(--#{$pf-global}--BackgroundColor--300);
--#{$dropdown}__menu--Top: 100%;
--#{$dropdown}--m-top__menu--TranslateY: -100%;
Expand Down
13 changes: 10 additions & 3 deletions src/patternfly/components/DualListSelector/dual-list-selector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $pf-v5-c-dual-list-selector__item--MaxNesting: 10;
// List item
--#{$dual-list-selector}__list-item-row--FontSize: var(--#{$pf-global}--FontSize--sm);
--#{$dual-list-selector}__list-item-row--BackgroundColor: transparent;
--#{$dual-list-selector}__list-item-row--hover--BackgroundColor: var(--#{$pf-global}--BackgroundColor--light-300);
--#{$dual-list-selector}__list-item-row--focus-within--BackgroundColor: var(--#{$pf-global}--BackgroundColor--light-300);
--#{$dual-list-selector}__list-item-row--m-selected--BackgroundColor: var(--#{$pf-global}--BackgroundColor--light-300);
--#{$dual-list-selector}__list-item-row--hover--BackgroundColor: var(--#{$pf-global}--BackgroundColor--200);
--#{$dual-list-selector}__list-item-row--focus-within--BackgroundColor: var(--#{$pf-global}--BackgroundColor--200);
--#{$dual-list-selector}__list-item-row--m-selected--BackgroundColor: var(--#{$pf-global}--BackgroundColor--200);
--#{$dual-list-selector}__list-item--m-ghost-row--BackgroundColor: var(--#{$pf-global}--BackgroundColor--100);
--#{$dual-list-selector}__list-item--m-ghost-row--Opacity: .4;

Expand Down Expand Up @@ -332,3 +332,10 @@ $pf-v5-c-dual-list-selector__item--MaxNesting: 10;
}
}
// stylelint-enable

// stylelint-disable no-invalid-position-at-import-rule
@import "themes/dark/dual-list-selector";

@include pf-v5-theme-dark {
@include pf-v5-theme-dark-dual-list-selector;
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ cssPrefix: pf-v5-c-dual-list-selector
{{/dual-list-selector-tools}}
{{#> dual-list-selector-status}}
{{#> dual-list-selector-status-text}}
1 of 5 items selected
3 of 5 items selected
{{/dual-list-selector-status-text}}
{{/dual-list-selector-status}}
{{#> dual-list-selector-menu}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "../../../../sass-utilities/themes/dark/all";

@mixin pf-v5-theme-dark-dual-list-selector() {
.#{$dual-list-selector} {
--#{$dual-list-selector}__list-item-row--hover--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
--#{$dual-list-selector}__list-item-row--focus-within--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
--#{$dual-list-selector}__list-item-row--m-selected--BackgroundColor: var(--#{$pf-global}--BackgroundColor--400);
}
}