-
Notifications
You must be signed in to change notification settings - Fork 1
/
_others.scss
30 lines (27 loc) · 944 Bytes
/
_others.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ** Others *******************************************************************
// -- Body Width Fix --
// Account for difference between 100vw and 100% when scroll bars are included on page.
// Center and trims the offset caused in most browsers by scroll bars when true
// https://github.com/jdillick/fluid-typography#vw-quirks--fixes
@mixin body-width-fix() {
@media screen {
width: 100vw;
margin-left: calc((100% - 100vw) / 2);
overflow-x: hidden;
}
}
$CACHED-BODY-WIDTH-FIX: false !default; // Don't change it!!
@mixin fluid-width-fix($is-width-fix) {
@if $is-width-fix and not $CACHED-BODY-WIDTH-FIX {
$CACHED-BODY-WIDTH-FIX: true !global; // Only 1 apply
html {
@include body-width-fix();
}
}
}
// -- Body Width Fix --
// Safari doesn't resize its values in an iframe if the iframe is resized.
// https://github.com/twbs/rfs#class-boolean
@mixin safari-iframe-resize-fix() {
min-width: 0vw;
}