Skip to content

Commit

Permalink
refactor: revert elevation system
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Nov 14, 2023
1 parent 11c9fe8 commit e005ebd
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/css/coreui-grid.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-grid.rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-grid.rtl.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-reboot.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-reboot.rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-reboot.rtl.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-utilities.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-utilities.rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui-utilities.rtl.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui.rtl.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/coreui.rtl.min.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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
1 change: 1 addition & 0 deletions scss/_date-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
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
1 change: 1 addition & 0 deletions scss/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
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
1 change: 1 addition & 0 deletions scss/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
position: sticky;
bottom: 0;
z-index: $zindex-fixed;
@include elevation(2, "top");
}
1 change: 1 addition & 0 deletions scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
position: sticky;
top: 0;
z-index: $zindex-sticky;
@include elevation(2);
}
}

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

Expand Down
1 change: 1 addition & 0 deletions scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
// We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
// gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
// See also https://github.com/twbs/bootstrap/issues/17695
@include elevation(24);
}

// Shell div to position the modal with bottom padding
Expand Down
1 change: 1 addition & 0 deletions scss/_time-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
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
2 changes: 2 additions & 0 deletions scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ $utilities: map-merge(
)
),
// scss-docs-end utils-shadow
// scss-docs-start utils-elevation
"elevation": (
property: box-shadow,
class: elevation,
values: $elevations
),
// scss-docs-end utils-elevation
// scss-docs-start utils-focus-ring
"focus-ring": (
css-var: true,
Expand Down
1 change: 1 addition & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ $enable-validation-icons: true !default;
$enable-negative-margins: false !default;
$enable-deprecation-messages: true !default;
$enable-important-utilities: true !default;
$enable-elevations: false !default;
$enable-ltr: true !default;
$enable-rtl: false !default;

Expand Down
1 change: 1 addition & 0 deletions scss/forms/_form-multi-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ 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
13 changes: 13 additions & 0 deletions scss/mixins/_elevation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@mixin elevation($value, $exclude: null) {
@if $enable-elevations {
box-shadow: map-get($elevations, $value);

@if $enable-dark-mode {
[data-coreui-theme]:not([data-coreui-theme="dark"]) & {
&:not([class*="border"]) {
border: 0;
}
}
}
}
}
2 changes: 2 additions & 0 deletions scss/sidebar/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
position: fixed;
top: 0;
bottom: 0;
@include elevation(2);

&:not(.sidebar-end) {
@include ltr-rtl("left", 0);
Expand Down Expand Up @@ -132,6 +133,7 @@

&.show {
box-shadow: var(--#{$prefix}sidebar-overlaid-box-shadow);
@include elevation(3);

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

0 comments on commit e005ebd

Please sign in to comment.