forked from FrontendMatter/bootstrap-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_sidebar-layout.scss
More file actions
56 lines (56 loc) · 1.6 KB
/
Copy path_sidebar-layout.scss
File metadata and controls
56 lines (56 loc) · 1.6 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
54
55
56
@mixin sidebar-sizes($breakpoint: '') {
@if $breakpoint != '' {
$breakpoint: -#{$breakpoint};
}
@each $index in map-keys($sidebar-sizes) {
$size: map-get($sidebar-sizes, $index);
.sidebar-size-#{$index}#{$breakpoint} {
width: $size;
}
}
}
@mixin sidebar-layout($breakpoint: '') {
@if $breakpoint != '' {
$breakpoint: -#{$breakpoint};
}
@each $index in map-keys($sidebar-sizes) {
$size: map-get($sidebar-sizes, $index);
@each $d, $direction in (l: left, r: right) {
.layout-sidebar-#{$d}#{$index}#{$breakpoint} > .layout-content {
margin-#{$direction}: $size;
}
}
}
}
@mixin sidebar-sizes-percent($breakpoint: '') {
@if $breakpoint != '' {
$breakpoint: -#{$breakpoint};
}
@for $percent from ceil($sidebar-percent-from / $sidebar-percent-step) through ceil($sidebar-percent-through / $sidebar-percent-step) {
$percent: $percent * $sidebar-percent-step;
.sidebar-size-#{$percent}pc#{$breakpoint} {
width: round(percentage($percent / 100));
}
}
}
@mixin sidebar-layout-percent($breakpoint: '') {
@if $breakpoint != '' {
$breakpoint: -#{$breakpoint};
}
@for $percent from ceil($sidebar-percent-from / $sidebar-percent-step) through ceil($sidebar-percent-through / $sidebar-percent-step) {
$percent: $percent * $sidebar-percent-step;
@each $d, $direction in (l: left, r: right) {
.layout-sidebar-#{$d}#{$percent}pc#{$breakpoint} > .layout-content {
margin-#{$direction}: round(percentage($percent / 100));
}
}
}
}
@mixin sidebar-visible($breakpoint: '') {
@if $breakpoint != '' {
$breakpoint: -#{$breakpoint};
}
&.sidebar-visible#{$breakpoint} {
display: block;
}
}