Skip to content

Commit

Permalink
fix: fix failing postcss of calc usage with minus values
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Oct 22, 2020
1 parent d77736b commit 959096c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,7 @@ button.dnb-button::-moz-focus-inner {
:root {
--modal-z-index: 3000;
--modal-spacing: 2rem;
--modal-spacing-minus: -2rem;
--modal-min-width: 20rem;
--modal-avg-width: 60vw;
--modal-max-width: 60rem;
Expand Down Expand Up @@ -1497,12 +1498,12 @@ button.dnb-button::-moz-focus-inner {
padding-top: calc(var(--modal-spacing) * 0.75); }
.dnb-modal__wrapper__inner {
padding-bottom: calc(var(--modal-spacing) * 2);
margin-bottom: calc(var(--modal-spacing) * -1.75); }
margin-bottom: calc(var(--modal-spacing-minus) * 1.75); }
@media screen and (max-width: 40em) {
.dnb-modal__wrapper__inner.dnb-section::after {
min-height: calc( 100vh - var(--modal-content-top) - calc(var(--modal-spacing) * 1.5)); } }
.dnb-modal__content--drawer .dnb-modal__wrapper__inner {
margin-bottom: calc(var(--modal-spacing) * -2); }
margin-bottom: calc(var(--modal-spacing-minus) * 2); }
.dnb-modal__content--drawer .dnb-modal__wrapper__inner.dnb-section::after {
min-height: calc( 100vh - var(--modal-drawer-content-top) - calc(var(--modal-spacing) * 2)); }
.dnb-modal__close-button {
Expand Down
5 changes: 3 additions & 2 deletions packages/dnb-ui-lib/src/components/modal/style/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:root {
--modal-z-index: 3000;
--modal-spacing: 2rem; // should reflect --spacing-large
--modal-spacing-minus: -2rem; // should reflect --spacing-large

// we do this because SCSS fails by using min(100vw, 50rem) = "Incompatible units: 'rem' and 'vw'"
--modal-min-width: 20rem; // under 40em, because of spacing and later mobile fullscreen
Expand Down Expand Up @@ -247,7 +248,7 @@

&__wrapper__inner {
padding-bottom: calc(var(--modal-spacing) * 2);
margin-bottom: calc(var(--modal-spacing) * -1.75);
margin-bottom: calc(var(--modal-spacing-minus) * 1.75);

@include allBelow(small) {
&.dnb-section::after {
Expand All @@ -259,7 +260,7 @@
}
}
&__content--drawer &__wrapper__inner {
margin-bottom: calc(var(--modal-spacing) * -2);
margin-bottom: calc(var(--modal-spacing-minus) * 2);

&.dnb-section::after {
min-height: calc(
Expand Down

0 comments on commit 959096c

Please sign in to comment.