| 1 |
// Adapted from Bootstrap v5.0.2 (https://getbootstrap.com/) |
| 2 |
// See: dist/css/bootstrap-grid.css |
| 3 |
// Copyright 2011-2021 The Bootstrap Authors |
| 4 |
// Copyright 2011-2019 Twitter, Inc. |
| 5 |
// Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
| 6 |
@use 'sass:math'; |
| 7 |
|
| 8 |
$gutter-widths: $spacings; |
| 9 |
|
| 10 |
.sd-container, |
| 11 |
.sd-container-fluid, |
| 12 |
.sd-container-lg, |
| 13 |
.sd-container-md, |
| 14 |
.sd-container-sm, |
| 15 |
.sd-container-xl { |
| 16 |
margin-left: auto; |
| 17 |
margin-right: auto; |
| 18 |
padding-left: var(--sd-gutter-x, 0.75rem); |
| 19 |
padding-right: var(--sd-gutter-x, 0.75rem); |
| 20 |
width: 100%; |
| 21 |
} |
| 22 |
|
| 23 |
@media (min-width: $media-min-sm) { |
| 24 |
.sd-container-sm, |
| 25 |
.sd-container { |
| 26 |
max-width: $media-max-sm; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
@media (min-width: $media-min-md) { |
| 31 |
.sd-container-md, |
| 32 |
.sd-container-sm, |
| 33 |
.sd-container { |
| 34 |
max-width: $media-max-md; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
@media (min-width: $media-min-lg) { |
| 39 |
.sd-container-lg, |
| 40 |
.sd-container-md, |
| 41 |
.sd-container-sm, |
| 42 |
.sd-container { |
| 43 |
max-width: $media-max-lg; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
@media (min-width: $media-min-xl) { |
| 48 |
.sd-container-xl, |
| 49 |
.sd-container-lg, |
| 50 |
.sd-container-md, |
| 51 |
.sd-container-sm, |
| 52 |
.sd-container { |
| 53 |
max-width: $media-max-xl; |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
.sd-row { |
| 58 |
--sd-gutter-x: 1.5rem; |
| 59 |
--sd-gutter-y: 0; |
| 60 |
display: -ms-flexbox; |
| 61 |
display: flex; |
| 62 |
-ms-flex-wrap: wrap; |
| 63 |
flex-wrap: wrap; |
| 64 |
margin-top: calc(var(--sd-gutter-y) * -1); |
| 65 |
margin-right: calc(var(--sd-gutter-x) * -0.5); |
| 66 |
margin-left: calc(var(--sd-gutter-x) * -0.5); |
| 67 |
} |
| 68 |
|
| 69 |
.sd-row > * { |
| 70 |
box-sizing: border-box; |
| 71 |
flex-shrink: 0; |
| 72 |
width: 100%; |
| 73 |
max-width: 100%; |
| 74 |
padding-right: calc(var(--sd-gutter-x) * 0.5); |
| 75 |
padding-left: calc(var(--sd-gutter-x) * 0.5); |
| 76 |
margin-top: var(--sd-gutter-y); |
| 77 |
} |
| 78 |
|
| 79 |
.sd-col { |
| 80 |
flex: 1 0 0%; |
| 81 |
-ms-flex: 1 0 0%; |
| 82 |
} |
| 83 |
|
| 84 |
.sd-row-cols-auto > * { |
| 85 |
flex: 0 0 auto; |
| 86 |
width: auto; |
| 87 |
} |
| 88 |
|
| 89 |
@for $i from 1 through 12 { |
| 90 |
.sd-row-cols-#{$i} { |
| 91 |
> * { |
| 92 |
flex: 0 0 auto; |
| 93 |
-ms-flex: 0 0 auto; |
| 94 |
width: math.div(100%, $i); |
| 95 |
} |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
@each $cat, $width in $media-widths { |
| 100 |
@media (min-width: $width) { |
| 101 |
.sd-col-#{$cat} { |
| 102 |
flex: 1 0 0%; |
| 103 |
-ms-flex: 1 0 0%; |
| 104 |
} |
| 105 |
|
| 106 |
.sd-row-cols-#{$cat}-auto { |
| 107 |
flex: 1 0 auto; |
| 108 |
-ms-flex: 1 0 auto; |
| 109 |
width: 100%; |
| 110 |
} |
| 111 |
|
| 112 |
@for $i from 1 through 12 { |
| 113 |
.sd-row-cols-#{$cat}-#{$i} { |
| 114 |
> * { |
| 115 |
flex: 0 0 auto; |
| 116 |
-ms-flex: 0 0 auto; |
| 117 |
width: math.div(100%, $i); |
| 118 |
} |
| 119 |
} |
| 120 |
} |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
.sd-col-auto { |
| 125 |
flex: 0 0 auto; |
| 126 |
-ms-flex: 0 0 auto; |
| 127 |
width: auto; |
| 128 |
} |
| 129 |
|
| 130 |
@for $i from 1 through 12 { |
| 131 |
.sd-col-#{$i} { |
| 132 |
flex: 0 0 auto; |
| 133 |
-ms-flex: 0 0 auto; |
| 134 |
width: 100% * math.div($i, 12); |
| 135 |
} |
| 136 |
} |
| 137 |
|
| 138 |
@each $cat, $width in $gutter-widths { |
| 139 |
.sd-g-#{$cat}, |
| 140 |
.sd-gy-#{$cat} { |
| 141 |
--sd-gutter-y: #{$width}; |
| 142 |
} |
| 143 |
.sd-g-#{$cat}, |
| 144 |
.sd-gx-#{$cat} { |
| 145 |
--sd-gutter-x: #{$width}; |
| 146 |
} |
| 147 |
} |
| 148 |
|
| 149 |
@each $cat, $width in $media-widths { |
| 150 |
@media (min-width: $width) { |
| 151 |
.sd-col-#{$cat}-auto { |
| 152 |
-ms-flex: 0 0 auto; |
| 153 |
flex: 0 0 auto; |
| 154 |
width: auto; |
| 155 |
} |
| 156 |
@for $i from 1 through 12 { |
| 157 |
.sd-col-#{$cat}-#{$i} { |
| 158 |
-ms-flex: 0 0 auto; |
| 159 |
flex: 0 0 auto; |
| 160 |
width: 100% * math.div($i, 12); |
| 161 |
} |
| 162 |
} |
| 163 |
@each $gcat, $gwidth in $gutter-widths { |
| 164 |
.sd-g-#{$cat}-#{$gcat}, |
| 165 |
.sd-gy-#{$cat}-#{$gcat} { |
| 166 |
--sd-gutter-y: #{$gwidth}; |
| 167 |
} |
| 168 |
.sd-g-#{$cat}-#{$gcat}, |
| 169 |
.sd-gx-#{$cat}-#{$gcat} { |
| 170 |
--sd-gutter-x: #{$gwidth}; |
| 171 |
} |
| 172 |
} |
| 173 |
} |
| 174 |
} |
| 175 |
|
| 176 |
.sd-flex-row-reverse { |
| 177 |
flex-direction: row-reverse !important; |
| 178 |
} |