UNPKG

2.05 kBSCSSView Raw
1@import '~bootstrap-sass/assets/stylesheets/bootstrap/mixins';
2
3// Animation
4@mixin create-animation($animation-name, $args...) {
5 #{$animation-name} {
6 animation: $args;
7 }
8}
9
10// Filter
11@mixin filter($args...) {
12 // sass-lint:disable-block no-vendor-prefixes
13 -webkit-filter: $args;
14 -moz-filter: $args;
15 -o-filter: $args;
16 -ms-filter: $args;
17 filter: $args;
18}
19
20// Smooth scrolling
21// http://weblog.west-wind.com/posts/2013/Jun/01/Smoothing-out-div-scrolling-in-Mobile-WebKit-Browsers
22@mixin overflow($horizontal, $vertical) {
23 // sass-lint:disable-block no-vendor-prefixes
24 overflow-x: $horizontal;
25 overflow-y: $vertical;
26 -ms-overflow-style: -ms-autohiding-scrollbar;
27 -webkit-overflow-scrolling: touch; // sass-lint:disable-line no-misspelled-properties
28}
29
30// Spacing
31@mixin spacer($property, $side, $value: $spacer-size) {
32 @if ($side == top) or ($side == right) or ($side == bottom) or ($side == left) {
33 #{$property}-#{$side}: $value;
34 }
35 @else if ($side == vertical) {
36 #{$property}-top: $value;
37 #{$property}-bottom: $value;
38 }
39 @else if ($side == horizontal) {
40 #{$property}-right: $value;
41 #{$property}-left: $value;
42 }
43 @else if ($side == all) {
44 #{$property}: $value;
45 }
46 @else {
47 @error 'Invalid spacer side argument: #{$side}';
48 }
49}
50
51@mixin create-spacers($prefix, $property, $side, $value) {
52 @if ($value > 0) {
53 #{$prefix}-auto {
54 @include spacer($property, $side, auto);
55 }
56 }
57
58 #{$prefix}-0 {
59 @include spacer($property, $side, 0);
60 }
61
62 #{$prefix}-xxs {
63 @include spacer($property, $side, $value * 0.125);
64 }
65
66 #{$prefix}-xs {
67 @include spacer($property, $side, $value * 0.25);
68 }
69
70 #{$prefix}-sm {
71 @include spacer($property, $side, $value * 0.5);
72 }
73
74 #{$prefix}-md {
75 @include spacer($property, $side, $value);
76 }
77
78 #{$prefix}-lg {
79 @include spacer($property, $side, $value * 2);
80 }
81
82 #{$prefix}-xl {
83 @include spacer($property, $side, $value * 3);
84 }
85
86 #{$prefix}-xxl {
87 @include spacer($property, $side, $value * 5);
88 }
89}