Skip to content

Commit

Permalink
ensure matching breakpoint ranges in mixins with docs
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Sep 4, 2024
1 parent a5ff2a9 commit 30a36fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions packages/dnb-eufemia/src/style/core/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ $breakpoint-offset: 0;
// @include allAbove(medium){ styles go here.. }
// $offset and $list are needed to provide global customization options
@mixin allAbove($size, $offset: $breakpoint-offset, $list: $breakpoints) {
@media screen and (min-width: (if(map-has-key($list, $size), map-get($list, $size), #{$size}) + $offset)) {
@media screen and (min-width: (if(map-has-key($list, $size), map-get($list, $size), #{$size}) + $offset + 0.0625em)) {
@content;
}
}
Expand All @@ -301,11 +301,8 @@ $breakpoint-offset: 0;
}
}
@mixin allBetween($fromSize, $toSize, $fromOffset: null, $toOffset: null) {
@include allBelow($toSize, if($toOffset == null, -0.0625em, $toOffset)) {
@include allAbove(
$fromSize,
if($fromOffset == null, 0.0625em, $fromOffset)
) {
@include allBelow($toSize, if($toOffset == null, 0, $toOffset)) {
@include allAbove($fromSize, if($fromOffset == null, 0, $fromOffset)) {
@content;
}
}
Expand Down

0 comments on commit 30a36fb

Please sign in to comment.