Skip to content

Commit 8acd9e2

Browse files
committed
Fix: Some style is not applied if it is between two viewport sizes.
This is the alternative implementation as mentioned in the PR jgthms#3990. Related issue: jgthms#3961
1 parent 7c526b1 commit 8acd9e2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sass/utilities/mixins.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,19 @@
272272
}
273273

274274
@mixin until($device) {
275-
@media screen and (max-width: ($device - 1px)) {
275+
@media screen and (max-width: ($device - 0.02px)) {
276276
@content;
277277
}
278278
}
279279

280280
@mixin between($from, $until) {
281-
@media screen and (min-width: $from) and (max-width: ($until - 1px)) {
281+
@media screen and (min-width: $from) and (max-width: ($until - 0.02px)) {
282282
@content;
283283
}
284284
}
285285

286286
@mixin mobile {
287-
@media screen and (max-width: (iv.$tablet - 1px)) {
287+
@media screen and (max-width: (iv.$tablet - 0.02px)) {
288288
@content;
289289
}
290290
}
@@ -296,13 +296,13 @@
296296
}
297297

298298
@mixin tablet-only {
299-
@media screen and (min-width: iv.$tablet) and (max-width: (iv.$desktop - 1px)) {
299+
@media screen and (min-width: iv.$tablet) and (max-width: (iv.$desktop - 0.02px)) {
300300
@content;
301301
}
302302
}
303303

304304
@mixin touch {
305-
@media screen and (max-width: (iv.$desktop - 1px)) {
305+
@media screen and (max-width: (iv.$desktop - 0.02px)) {
306306
@content;
307307
}
308308
}
@@ -315,15 +315,15 @@
315315

316316
@mixin desktop-only {
317317
@if iv.$widescreen-enabled {
318-
@media screen and (min-width: iv.$desktop) and (max-width: (iv.$widescreen - 1px)) {
318+
@media screen and (min-width: iv.$desktop) and (max-width: (iv.$widescreen - 0.02px)) {
319319
@content;
320320
}
321321
}
322322
}
323323

324324
@mixin until-widescreen {
325325
@if iv.$widescreen-enabled {
326-
@media screen and (max-width: (iv.$widescreen - 1px)) {
326+
@media screen and (max-width: (iv.$widescreen - 0.02px)) {
327327
@content;
328328
}
329329
}
@@ -339,15 +339,15 @@
339339

340340
@mixin widescreen-only {
341341
@if iv.$widescreen-enabled and iv.$fullhd-enabled {
342-
@media screen and (min-width: iv.$widescreen) and (max-width: (iv.$fullhd - 1px)) {
342+
@media screen and (min-width: iv.$widescreen) and (max-width: (iv.$fullhd - 0.02px)) {
343343
@content;
344344
}
345345
}
346346
}
347347

348348
@mixin until-fullhd {
349349
@if iv.$fullhd-enabled {
350-
@media screen and (max-width: (iv.$fullhd - 1px)) {
350+
@media screen and (max-width: (iv.$fullhd - 0.02px)) {
351351
@content;
352352
}
353353
}
@@ -391,7 +391,7 @@
391391
}
392392

393393
@mixin container-until($name, $width) {
394-
@container #{$name} (max-width: #{$width - 1px}) {
394+
@container #{$name} (max-width: #{$width - 0.02px}) {
395395
@content;
396396
}
397397
}

0 commit comments

Comments
 (0)