forked from tweeb/objects.layout-whitespace-fix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_objects.layout-whitespace-fix.scss
More file actions
53 lines (39 loc) · 1.39 KB
/
_objects.layout-whitespace-fix.scss
File metadata and controls
53 lines (39 loc) · 1.39 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*------------------------------------*\
#LAYOUT-WHITESPACE-FIX
\*------------------------------------*/
// Predefine the variables below in order to alter and enable specific features.
$inuit-enable-layout--punctual-fix: false !default;
/**
* The inuitcss layout system uses `display: inline-block;` means that
* the layout items need their whitespace removing in order for them
* to work correctly.
*
* This extension is based on the font size zero method.
* Use it only if you can't remove whitespace directly in your HTML.
*
* 1. Remove whitespace between child element.
* 2. Restore font-size to `$inuit-base-font-size` using `font-size` mixin.
*/
@if ($inuit-enable-layout--punctual-fix == false) {
.#{$inuit-layout-namespace}layout,
%#{$inuit-layout-namespace}layout {
font-size: 0; /* [1] */
}
.#{$inuit-layout-namespace}layout__item,
%#{$inuit-layout-namespace}layout__item {
@include inuit-font-size($inuit-base-font-size, none); /* [2] */
}
}
@else {
/**
* Remove whitespace punctually
*/
.#{$inuit-layout-namespace}layout--fix,
%#{$inuit-layout-namespace}layout--fix {
font-size: 0; /* [1] */
> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
@include inuit-font-size($inuit-base-font-size, none); /* [2] */
}
}
}