-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathcol.scss
More file actions
61 lines (49 loc) · 1.81 KB
/
col.scss
File metadata and controls
61 lines (49 loc) · 1.81 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
57
58
59
60
61
@import "./col.vars";
// Column
// --------------------------------------------------
:host {
/**
* @prop --col-unit-size: The size of each Column unit.
*/
--col-unit-size: calc((100% - (var(--ion-grid-columns, 12) - 1) * var(--ion-grid-gap)) / var(--ion-grid-columns, 12));
/**
* @prop --ion-grid-columns: The number of total Columns in the Grid
* @prop --ion-grid-column-padding: Padding for the Column
* @prop --ion-grid-column-padding-xs: Padding for the Column on xs screens and up
* @prop --ion-grid-column-padding-sm: Padding for the Column on sm screens and up
* @prop --ion-grid-column-padding-md: Padding for the Column on md screens and up
* @prop --ion-grid-column-padding-lg: Padding for the Column on lg screens and up
* @prop --ion-grid-column-padding-xl: Padding for the Column on xl screens and up
*/
@include make-breakpoint-padding($grid-column-paddings);
@include margin(0);
box-sizing: border-box;
position: relative;
flex-basis: 0;
flex-grow: 1;
width: 100%;
max-width: 100%;
min-height: 1px; // Prevent columns from collapsing when empty
}
:host(.ion-grid-col-auto){
flex: 0 0 auto;
}
:host(
[class^="ion-grid-col-"],
[class*=" ion-grid-col-"]) {
flex: 0 0
calc(var(--ion-grid-col-span) * var(--col-unit-size) +
(var(--ion-grid-col-span) - 1) * var(--ion-grid-gap));
}
:host(
[class^="ion-grid-offset-col-"],
[class*=" ion-grid-offset-col-"]) {
--margin-calc: calc(var(--col-unit-size) * var(--ion-grid-col-margin) + (var(--ion-grid-gap) * var(--ion-grid-col-margin)));
@include margin-horizontal(var(--margin-calc), 0);
}
$max: 12;
@for $i from 1 through $max {
.ion-grid-col-#{$i} { --ion-grid-col-span: #{$i}; }
.ion-grid-order-col-#{$i} { order: #{$i}; }
.ion-grid-offset-col-#{$i} { --ion-grid-col-margin: #{$i};}
}