Skip to content

Commit

Permalink
refactor: remove elevations from components and update elevation util…
Browse files Browse the repository at this point in the history
…ity classes
  • Loading branch information
mrholek committed Jul 5, 2023
1 parent c119ba8 commit 4bf4e35
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 92 deletions.
9 changes: 0 additions & 9 deletions scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
border: var(--#{$prefix}card-border-width) solid var(--#{$prefix}card-border-color);
@include border-radius(var(--#{$prefix}card-border-radius));
@include box-shadow(var(--#{$prefix}card-box-shadow));
@include elevation(1);

> hr {
margin-right: 0;
Expand Down Expand Up @@ -238,11 +237,3 @@
}
}
}

@if $enable-dark-mode and $enable-elevations {
@include color-mode(dark) {
.card:not([class*="border"]):not([class*="elevation-0"]) {
background-color: color-mix(in srgb, var(--#{$prefix}card-bg) 98%, #fff);
}
}
}
9 changes: 0 additions & 9 deletions scss/_date-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
background-clip: padding-box;
border: var(--#{$prefix}date-picker-dropdown-border-width) solid var(--#{$prefix}date-picker-dropdown-border-color);
@include border-radius(var(--#{$prefix}date-picker-dropdown-border-radius));
@include elevation(4);

.date-picker.show & {
display: block;
Expand Down Expand Up @@ -278,11 +277,3 @@
}
}
}

@if $enable-dark-mode and $enable-elevations {
@include color-mode(dark) {
.date-picker-dropdown {
background-color: color-mix(in srgb, var(--#{$prefix}date-picker-dropdown-bg) 96%, #fff);
}
}
}
9 changes: 0 additions & 9 deletions scss/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
border: var(--#{$prefix}dropdown-border-width) solid var(--#{$prefix}dropdown-border-color);
@include border-radius(var(--#{$prefix}dropdown-border-radius));
@include box-shadow(var(--#{$prefix}dropdown-box-shadow));
@include elevation(4);

&[data-coreui-popper] {
top: 100%;
Expand Down Expand Up @@ -249,11 +248,3 @@
--#{$prefix}dropdown-header-color: #{$dropdown-dark-header-color};
// scss-docs-end dropdown-dark-css-vars
}

@if $enable-dark-mode and $enable-elevations {
@include color-mode(dark) {
.dropdown-menu {
background-color: color-mix(in srgb, var(--#{$prefix}dropdown-bg) 96%, #fff);
}
}
}
1 change: 0 additions & 1 deletion scss/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@
position: sticky;
bottom: 0;
z-index: $zindex-fixed;
@include elevation(2, "top");
}
1 change: 0 additions & 1 deletion scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
position: sticky;
top: 0;
z-index: $zindex-fixed - 1;
@include elevation(2);
}
}

Expand Down
1 change: 0 additions & 1 deletion scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
// Skins
@import "mixins/border-radius";
@import "mixins/box-shadow";
@import "mixins/elevation";
@import "mixins/gradients";
@import "mixins/transition";

Expand Down
1 change: 0 additions & 1 deletion scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
@include box-shadow(var(--#{$prefix}modal-box-shadow));
// Remove focus outline from opened modal
outline: 0;
@include elevation(24);
}

// Modal background
Expand Down
1 change: 0 additions & 1 deletion scss/_subheader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
position: sticky;
top: 0;
z-index: $zindex-fixed - 1;
@include elevation(2);
}

// Subheader nav
Expand Down
9 changes: 0 additions & 9 deletions scss/_time-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
background-clip: padding-box;
border: var(--#{$prefix}time-picker-dropdown-border-width) solid var(--#{$prefix}time-picker-dropdown-border-color);
@include border-radius(var(--#{$prefix}time-picker-dropdown-border-radius));
@include elevation(4);

.time-picker.show & {
display: block;
Expand Down Expand Up @@ -288,11 +287,3 @@
}
}
}

@if $enable-dark-mode and $enable-elevations {
@include color-mode(dark) {
.time-picker-dropdown {
background-color: color-mix(in srgb, var(--#{$prefix}time-picker-dropdown-bg) 96%, #fff);
}
}
}
18 changes: 6 additions & 12 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ $enable-validation-icons: true !default;
$enable-negative-margins: false !default;
$enable-deprecation-messages: true !default;
$enable-important-utilities: true !default;
$enable-elevations: true !default;
$enable-ltr: true !default;
$enable-rtl: false !default;

Expand Down Expand Up @@ -510,14 +509,9 @@ $elevations: (
0: unquote("none"),
1: unquote("0 1px 1px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 2px 1px -1px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 3px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
2: unquote("0 2px 2px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 1px -2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 5px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
3: unquote("0 3px 4px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 3px -2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 8px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
4: unquote("0 4px 5px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 1px 10px 0 rgba(var(--#{$prefix}elevation-base-color), .12), 0 2px 4px -1px rgba(var(--#{$prefix}elevation-base-color), .20)"),
6: unquote("0 6px 10px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 1px 18px 0 rgba(var(--#{$prefix}elevation-base-color), .12), 0 3px 5px -1px rgba(var(--#{$prefix}elevation-base-color), .20)"),
8: unquote("0 8px 10px 1px rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 14px 2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 5px 5px -3px rgba(var(--#{$prefix}elevation-base-color), .20)"),
9: unquote("0 9px 12px 1px rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 16px 2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 5px 6px -3px rgba(var(--#{$prefix}elevation-base-color), .20)"),
12: unquote("0 12px 17px 2px rgba(var(--#{$prefix}elevation-base-color), .14), 0 5px 22px 4px rgba(var(--#{$prefix}elevation-base-color), .12), 0 7px 8px -4px rgba(var(--#{$prefix}elevation-base-color), .20)"),
16: unquote("0 16px 24px 2px rgba(var(--#{$prefix}elevation-base-color), .14), 0 6px 30px 5px rgba(var(--#{$prefix}elevation-base-color), .12), 0 8px 10px -5px rgba(var(--#{$prefix}elevation-base-color), .20)"),
24: unquote("0 24px 38px 3px rgba(var(--#{$prefix}elevation-base-color), .14), 0 9px 46px 8px rgba(var(--#{$prefix}elevation-base-color), .12), 0 11px 15px -7px rgba(var(--#{$prefix}elevation-base-color), .20)")
3: unquote("0 6px 10px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 1px 18px 0 rgba(var(--#{$prefix}elevation-base-color), .12), 0 3px 5px -1px rgba(var(--#{$prefix}elevation-base-color), .20)"),
4: unquote("0 8px 10px 1px rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 14px 2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 5px 5px -3px rgba(var(--#{$prefix}elevation-base-color), .20)"),
5: unquote("0 12px 17px 2px rgba(var(--#{$prefix}elevation-base-color), .14), 0 5px 22px 4px rgba(var(--#{$prefix}elevation-base-color), .12), 0 7px 8px -4px rgba(var(--#{$prefix}elevation-base-color), .20)"),
) !default;

// Body
Expand Down Expand Up @@ -654,7 +648,7 @@ $box-shadow-inset: inset 0 1px 2px rgba($black, .075) !default;
// scss-docs-end box-shadow-variables

$component-active-color: $high-emphasis-inverse !default;
$component-active-bg: $primary !default;
$component-active-bg: var(--#{$prefix}primary) !default;

// scss-docs-start focus-ring-variables
$focus-ring-width: .25rem !default;
Expand Down Expand Up @@ -1028,7 +1022,7 @@ $input-border-radius-sm: var(--#{$prefix}border-radius-sm) !defau
$input-border-radius-lg: var(--#{$prefix}border-radius-lg) !default;

$input-focus-bg: $input-bg !default;
$input-focus-border-color: tint-color($component-active-bg, 50%) !default;
$input-focus-border-color: tint-color($primary, 50%) !default;
$input-focus-color: $input-color !default;
$input-focus-width: $input-btn-focus-width !default;
$input-focus-box-shadow: $input-btn-focus-box-shadow !default;
Expand Down Expand Up @@ -1334,7 +1328,7 @@ $form-range-thumb-border-radius: 1rem !default;
$form-range-thumb-box-shadow: 0 .1rem .25rem rgba($black, .1) !default;
$form-range-thumb-focus-box-shadow: 0 0 0 1px $body-bg, $input-focus-box-shadow !default;
$form-range-thumb-focus-box-shadow-width: $input-focus-width !default; // For focus box shadow issue in Edge
$form-range-thumb-active-bg: tint-color($component-active-bg, 70%) !default;
$form-range-thumb-active-bg: tint-color($primary, 70%) !default;
$form-range-thumb-disabled-bg: var(--#{$prefix}secondary-color) !default;
$form-range-thumb-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default;
// scss-docs-end form-range-variables
Expand Down
13 changes: 0 additions & 13 deletions scss/forms/_form-multi-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ select.form-multi-select {
background-clip: padding-box;
border: var(--#{$prefix}form-multi-select-dropdown-border-width) solid var(--#{$prefix}form-multi-select-dropdown-border-color);
@include border-radius(var(--#{$prefix}form-multi-select-dropdown-border-radius));
@include elevation(4);

.form-multi-select.show & {
display: block;
Expand Down Expand Up @@ -447,15 +446,3 @@ select.form-multi-select {
}
}
}

@if $enable-dark-mode and $enable-elevations {
@include color-mode(dark) {
.form-multi-select-dropdown {
background-color: color-mix(in srgb, var(--#{$prefix}form-multi-select-dropdown-bg) 96%, #fff);
}

.form-multi-select-option-with-checkbox::before {
background-color: color-mix(in srgb, var(--#{$prefix}form-multi-select-option-indicator-bg) 96%, #fff);
}
}
}
21 changes: 0 additions & 21 deletions scss/mixins/_elevation.scss

This file was deleted.

5 changes: 0 additions & 5 deletions scss/sidebar/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
top: 0;
bottom: 0;
z-index: $zindex-fixed;
@include elevation(2);

&:not(.sidebar-end) {
@include ltr-rtl("left", 0);
Expand All @@ -160,10 +159,6 @@
bottom: 0;
z-index: $zindex-fixed + 2;

&:not(.hide) {
@include elevation(3);
}

&:not(.sidebar-end) {
@include ltr-rtl("left", 0);
~ * {
Expand Down

0 comments on commit 4bf4e35

Please sign in to comment.