Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #206 from pxblue/feature/ng-disabled-button-styles
Browse files Browse the repository at this point in the history
Disabled state for primary accent warn buttons
  • Loading branch information
EvanMcLaughlin-eaton authored Jun 30, 2021
2 parents 309790c + 9692d24 commit 53b6212
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
4 changes: 4 additions & 0 deletions angular/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Fixed a few color issues in the `<pxb-drawer-header>` ([#184](https://github.com/pxblue/themes/issues/184)) and `<pxb-drawer-nav-item>` ([#186](https://github.com/pxblue/themes/issues/186)).

### Changed

- Changed `mat-button` styles for disabled `primary`, `accent`, and `warn` variants.

## v6.1.0 (May 28, 2021)

### Added
Expand Down
18 changes: 17 additions & 1 deletion angular/_blueTheme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
text: map-get($pxb-white, 50),
background: map-get($primary, 500),
backgroundHover: map-get($primary, 300),
disabled: (
text: map-get($primary, 200),
background: map-get($primary, 50),
),
),
);
$buttonAccent: (
Expand All @@ -149,6 +153,10 @@
text: map-get($pxb-white, 50),
background: map-get($accent, 500),
backgroundHover: map-get($accent, 300),
disabled: (
text: map-get($accent, 200),
background: map-get($accent, 50),
),
),
);
$buttonWarn: (
Expand All @@ -165,6 +173,10 @@
text: map-get($pxb-white, 50),
background: map-get($warn, 500),
backgroundHover: map-get($warn, 300),
disabled: (
text: map-get($warn, 200),
background: map-get($warn, 50),
),
),
);
$buttonDefault: (
Expand All @@ -181,6 +193,10 @@
text: map-get($pxb-black, 500),
background: map-get($pxb-white, 50),
backgroundHover: rgba(66, 78, 84, 0.05),
disabled: (
text: map-get($foreground, disabled),
background: map-get($background, disabled-button),
),
),
toggle: (
border: map-get($pxb-gray, 100),
Expand All @@ -200,7 +216,7 @@
.mat-stroked-button,
.mat-raised-button {
&.mat-button-disabled {
background-color: map-get($pxb-white, 50) !important;
// background-color: map-get($pxb-white, 50) !important;
color: map-get($foreground, disabled);
border: solid 1px map-get($foreground, divider);
}
Expand Down
22 changes: 21 additions & 1 deletion angular/_darkTheme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
text: map-get($pxb-white, 50),
background: map-get($primary, 500),
backgroundHover: map-get($primary, 300),
disabled: (
text: map-get($pxb-black, 400),
background: rgba(map-get($pxb-black, 200), 0.24),
),
),
);
$buttonAccent: (
Expand All @@ -108,6 +112,10 @@
text: map-get($pxb-white, 50),
background: map-get($accent, 500),
backgroundHover: map-get($accent, 300),
disabled: (
text: map-get($pxb-black, 400),
background: rgba(map-get($pxb-black, 200), 0.24),
),
),
);
$buttonWarn: (
Expand All @@ -124,6 +132,10 @@
text: map-get($pxb-white, 50),
background: map-get($warn, 500),
backgroundHover: map-get($pxb-red, 300),
disabled: (
text: map-get($pxb-black, 400),
background: rgba(map-get($pxb-black, 200), 0.24),
),
),
);
$buttonDefault: (
Expand All @@ -140,6 +152,10 @@
text: map-get($pxb-white, 50),
background: map-get($pxb-black, 500),
backgroundHover: map-get($pxb-black, 300),
disabled: (
text: map-get($pxb-black, 400),
background: rgba(map-get($pxb-black, 200), 0.24),
),
),
toggle: (
border: map-get($pxb-black, 200),
Expand All @@ -156,9 +172,13 @@
),
);
@include pxb-mat-buttons($buttonPrimary, $buttonAccent, $buttonWarn, $buttonDefault);
.mat-icon-button.mat-button-disabled.mat-button-disabled {
.mat-icon-button.mat-button-disabled {
color: map-get($foreground, disabled);
}
.mat-stroked-button.mat-button-disabled {
color: rgba(map-get($pxb-black, 300), 0.36);
border-color: rgba(map-get($pxb-black, 300), 0.36);
}

/* Tabs */
$tabText: map-get($foreground, secondary-text);
Expand Down
5 changes: 5 additions & 0 deletions angular/mixins/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@
&:hover:not(.mat-button-disabled) {
background-color: map-deep-get($palette, fill, backgroundHover);
}
&.mat-button-disabled {
color: map-deep-get($palette, fill, disabled, text);
background-color: map-deep-get($palette, fill, disabled, background);
border: none;
}
}
@mixin filled-button-helper($primaryPalette, $accentPalette, $warnPalette, $defaultPalette) {
&.mat-primary {
Expand Down

0 comments on commit 53b6212

Please sign in to comment.