@oardi/css-utils 0.47.1 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,104 +1,92 @@
1
1
  @use 'sass:map';
2
2
  @use './theme.scss';
3
3
 
4
- @each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
5
- @media (min-width: #{$bp-value}) {
6
- @each $key, $value in map.get(theme.$theme, spacings) {
7
- .gap-#{$bp}-#{$key} {
8
- gap: $value !important;
4
+ @layer utilities {
5
+ @each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
6
+ @media (min-width: #{$bp-value}) {
7
+ // basic
8
+ .d-#{$bp}-flex {
9
+ display: flex;
9
10
  }
10
11
 
11
- .row-gap-#{$bp}-#{$key} {
12
- row-gap: $value !important;
12
+ .d-#{$bp}-inline-flex {
13
+ display: inline-flex;
13
14
  }
14
15
 
15
- .column-gap-#{$bp}-#{$key} {
16
- column-gap: $value !important;
16
+ // directions
17
+ .flex-#{$bp}-row {
18
+ flex-direction: row;
17
19
  }
18
- }
19
-
20
- // basic
21
- .d-#{$bp}-flex {
22
- display: flex !important;
23
- }
24
-
25
- .d-#{$bp}-inline-flex {
26
- display: inline-flex !important;
27
- }
28
20
 
29
- // directions
30
- .flex-#{$bp}-row {
31
- flex-direction: row !important;
32
- }
33
-
34
- .flex-#{$bp}-column {
35
- flex-direction: column !important;
36
- }
21
+ .flex-#{$bp}-column {
22
+ flex-direction: column;
23
+ }
37
24
 
38
- .flex-#{$bp}-row-reverse {
39
- flex-direction: row-reverse !important;
40
- }
25
+ .flex-#{$bp}-row-reverse {
26
+ flex-direction: row-reverse;
27
+ }
41
28
 
42
- .flex-#{$bp}-column-reverse {
43
- flex-direction: column-reverse !important;
44
- }
29
+ .flex-#{$bp}-column-reverse {
30
+ flex-direction: column-reverse;
31
+ }
45
32
 
46
- // justify content - start, end, center, between, around, evenly
47
- .justify-content-#{$bp}-start {
48
- justify-content: start !important;
49
- }
33
+ // justify content - start, end, center, between, around, evenly
34
+ .justify-content-#{$bp}-start {
35
+ justify-content: start;
36
+ }
50
37
 
51
- .justify-content-#{$bp}-end {
52
- justify-content: end !important;
53
- }
38
+ .justify-content-#{$bp}-end {
39
+ justify-content: end;
40
+ }
54
41
 
55
- .justify-content-#{$bp}-center {
56
- justify-content: center !important;
57
- }
42
+ .justify-content-#{$bp}-center {
43
+ justify-content: center;
44
+ }
58
45
 
59
- .justify-content-#{$bp}-between {
60
- justify-content: space-between !important;
61
- }
46
+ .justify-content-#{$bp}-between {
47
+ justify-content: space-between;
48
+ }
62
49
 
63
- .justify-content-#{$bp}-around {
64
- justify-content: space-around !important;
65
- }
50
+ .justify-content-#{$bp}-around {
51
+ justify-content: space-around;
52
+ }
66
53
 
67
- .justify-content-#{$bp}-evenly {
68
- justify-content: space-evenly !important;
69
- }
54
+ .justify-content-#{$bp}-evenly {
55
+ justify-content: space-evenly;
56
+ }
70
57
 
71
- // align items - start, end, center, baseline, or stretch
72
- .align-items-#{$bp}-start {
73
- align-items: start !important;
74
- }
58
+ // align items - start, end, center, baseline, or stretch
59
+ .align-items-#{$bp}-start {
60
+ align-items: start;
61
+ }
75
62
 
76
- .align-items-#{$bp}-end {
77
- align-items: end !important;
78
- }
63
+ .align-items-#{$bp}-end {
64
+ align-items: end;
65
+ }
79
66
 
80
- .align-items-#{$bp}-center {
81
- align-items: center !important;
82
- }
67
+ .align-items-#{$bp}-center {
68
+ align-items: center;
69
+ }
83
70
 
84
- .align-items-#{$bp}-baseline {
85
- align-items: baseline !important;
86
- }
71
+ .align-items-#{$bp}-baseline {
72
+ align-items: baseline;
73
+ }
87
74
 
88
- .align-items-#{$bp}-stretch {
89
- align-items: stretch !important;
90
- }
75
+ .align-items-#{$bp}-stretch {
76
+ align-items: stretch;
77
+ }
91
78
 
92
- // align self
93
- // TODO
79
+ // align self
80
+ // TODO
94
81
 
95
- // fill
96
- // TODO
82
+ // fill
83
+ // TODO
97
84
 
98
- // grow
99
- // TODO
85
+ // grow
86
+ // TODO
100
87
 
101
- // shrink
102
- // TODO
88
+ // shrink
89
+ // TODO
90
+ }
103
91
  }
104
92
  }
package/scss/flex.scss CHANGED
@@ -1,166 +1,153 @@
1
1
  @use 'sass:map';
2
2
  @use './theme.scss' as theme;
3
3
 
4
- // TODO - use the following to iterate
5
- $flex-directions: (row, row-reverse, column, column-reverse);
6
- $flex-ratios: (0, 1);
7
- $flex-justify-content-alignments: (start, end, center, between, around, evenly);
8
- $flex-align-items-alignments: (start, end, center, between, around, evenly);
9
-
10
- // basic
11
- .d-flex {
12
- display: flex;
13
- }
14
-
15
- .d-inline-flex {
16
- display: inline-flex;
17
- }
18
-
19
- // directions
20
- .flex-row {
21
- flex-direction: row;
22
- }
23
-
24
- .flex-row-reverse {
25
- flex-direction: row-reverse;
26
- }
27
-
28
- .flex-column {
29
- flex-direction: column;
30
- }
4
+ @layer utilities {
5
+ // TODO - use the following to iterate
6
+ $flex-directions: (row, row-reverse, column, column-reverse);
7
+ $flex-ratios: (0, 1);
8
+ $flex-justify-content-alignments: (start, end, center, between, around, evenly);
9
+ $flex-align-items-alignments: (start, end, center, between, around, evenly);
10
+
11
+ // basic
12
+ .d-flex {
13
+ display: flex;
14
+ }
31
15
 
32
- .flex-column-reverse {
33
- flex-direction: column-reverse;
34
- }
16
+ .d-inline-flex {
17
+ display: inline-flex;
18
+ }
35
19
 
36
- // justify content - start, end, center, between, around or evenly
37
- .justify-content-start {
38
- justify-content: start;
39
- }
20
+ // directions
21
+ .flex-row {
22
+ flex-direction: row;
23
+ }
40
24
 
41
- .justify-content-end {
42
- justify-content: end;
43
- }
25
+ .flex-row-reverse {
26
+ flex-direction: row-reverse;
27
+ }
44
28
 
45
- .justify-content-center {
46
- justify-content: center;
47
- }
29
+ .flex-column {
30
+ flex-direction: column;
31
+ }
48
32
 
49
- .justify-content-between {
50
- justify-content: space-between;
51
- }
33
+ .flex-column-reverse {
34
+ flex-direction: column-reverse;
35
+ }
52
36
 
53
- .justify-content-around {
54
- justify-content: space-around;
55
- }
37
+ // justify content - start, end, center, between, around or evenly
38
+ .justify-content-start {
39
+ justify-content: start;
40
+ }
56
41
 
57
- .justify-content-evenly {
58
- justify-content: space-evenly;
59
- }
42
+ .justify-content-end {
43
+ justify-content: end;
44
+ }
60
45
 
61
- // align items - start, end, center, baseline, or stretch
62
- .align-items-start {
63
- align-items: start;
64
- }
46
+ .justify-content-center {
47
+ justify-content: center;
48
+ }
65
49
 
66
- .align-items-end {
67
- align-items: end;
68
- }
50
+ .justify-content-between {
51
+ justify-content: space-between;
52
+ }
69
53
 
70
- .align-items-center {
71
- align-items: center;
72
- }
54
+ .justify-content-around {
55
+ justify-content: space-around;
56
+ }
73
57
 
74
- .align-items-baseline {
75
- align-items: baseline;
76
- }
58
+ .justify-content-evenly {
59
+ justify-content: space-evenly;
60
+ }
77
61
 
78
- .align-items-stretch {
79
- align-items: stretch;
80
- }
62
+ // align items - start, end, center, baseline, or stretch
63
+ .align-items-start {
64
+ align-items: start;
65
+ }
81
66
 
82
- // align self
83
- // TODO
67
+ .align-items-end {
68
+ align-items: end;
69
+ }
84
70
 
85
- // fill
86
- .flex-fill {
87
- flex: 1 1 auto;
88
- }
71
+ .align-items-center {
72
+ align-items: center;
73
+ }
89
74
 
90
- // grow
91
- .flex-grow-0 {
92
- flex-grow: 0;
93
- }
75
+ .align-items-baseline {
76
+ align-items: baseline;
77
+ }
94
78
 
95
- .flex-grow-1 {
96
- flex-grow: 1;
97
- }
79
+ .align-items-stretch {
80
+ align-items: stretch;
81
+ }
98
82
 
99
- // shrink
100
- .flex-shrink-0 {
101
- flex-shrink: 0;
102
- }
83
+ // align self
84
+ // TODO
103
85
 
104
- .flex-shrink-1 {
105
- flex-shrink: 1;
106
- }
86
+ // fill
87
+ .flex-fill {
88
+ flex: 1 1 auto;
89
+ }
107
90
 
108
- // wrap
109
- .flex-wrap {
110
- flex-wrap: wrap;
111
- }
91
+ // grow
92
+ .flex-grow-0 {
93
+ flex-grow: 0;
94
+ }
112
95
 
113
- .flex-nowrap {
114
- flex-wrap: nowrap;
115
- }
96
+ .flex-grow-1 {
97
+ flex-grow: 1;
98
+ }
116
99
 
117
- // order
118
- .order-0 {
119
- order: 0;
120
- }
100
+ // shrink
101
+ .flex-shrink-0 {
102
+ flex-shrink: 0;
103
+ }
121
104
 
122
- .order-1 {
123
- order: 1;
124
- }
105
+ .flex-shrink-1 {
106
+ flex-shrink: 1;
107
+ }
125
108
 
126
- .order-2 {
127
- order: 2;
128
- }
109
+ // wrap
110
+ .flex-wrap {
111
+ flex-wrap: wrap;
112
+ }
129
113
 
130
- .order-3 {
131
- order: 3;
132
- }
114
+ .flex-nowrap {
115
+ flex-wrap: nowrap;
116
+ }
133
117
 
134
- .order-4 {
135
- order: 4;
136
- }
118
+ // order
119
+ .order-0 {
120
+ order: 0;
121
+ }
137
122
 
138
- .order-5 {
139
- order: 5;
140
- }
123
+ .order-1 {
124
+ order: 1;
125
+ }
141
126
 
142
- .order-first {
143
- order: -1;
144
- }
127
+ .order-2 {
128
+ order: 2;
129
+ }
145
130
 
146
- .order-last {
147
- order: 6;
148
- }
131
+ .order-3 {
132
+ order: 3;
133
+ }
149
134
 
150
- // align-content
151
- // TODO
135
+ .order-4 {
136
+ order: 4;
137
+ }
152
138
 
153
- // gap - move to own file?
154
- @each $key, $value in map.get(theme.$theme, spacings) {
155
- .gap-#{$key} {
156
- gap: $value !important;
139
+ .order-5 {
140
+ order: 5;
157
141
  }
158
142
 
159
- .row-gap-#{$key} {
160
- row-gap: $value !important;
143
+ .order-first {
144
+ order: -1;
161
145
  }
162
146
 
163
- .column-gap-#{$key} {
164
- column-gap: $value !important;
147
+ .order-last {
148
+ order: 6;
165
149
  }
150
+
151
+ // align-content
152
+ // TODO
166
153
  }
@@ -0,0 +1,22 @@
1
+ @use 'sass:map';
2
+ @use './theme.scss';
3
+
4
+ @layer utilities {
5
+ @each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
6
+ @media (min-width: #{$bp-value}) {
7
+ @each $key, $value in map.get(theme.$theme, spacings) {
8
+ .gap-#{$bp}-#{$key} {
9
+ gap: $value;
10
+ }
11
+
12
+ .row-gap-#{$bp}-#{$key} {
13
+ row-gap: $value;
14
+ }
15
+
16
+ .column-gap-#{$bp}-#{$key} {
17
+ column-gap: $value;
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
package/scss/gap.scss ADDED
@@ -0,0 +1,18 @@
1
+ @use 'sass:map';
2
+ @use './theme.scss' as theme;
3
+
4
+ @layer utilities {
5
+ @each $key, $value in map.get(theme.$theme, spacings) {
6
+ .gap-#{$key} {
7
+ gap: $value;
8
+ }
9
+
10
+ .row-gap-#{$key} {
11
+ row-gap: $value;
12
+ }
13
+
14
+ .column-gap-#{$key} {
15
+ column-gap: $value;
16
+ }
17
+ }
18
+ }
@@ -3,11 +3,13 @@
3
3
 
4
4
  // grid responsive
5
5
 
6
- @each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
7
- @media (min-width: #{$bp-value}) {
8
- @for $i from 1 through 12 {
9
- .col-#{$bp}-#{$i} {
10
- grid-column: span $i !important;
6
+ @layer utilities {
7
+ @each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
8
+ @media (min-width: #{$bp-value}) {
9
+ @for $i from 1 through 12 {
10
+ .col-#{$bp}-#{$i} {
11
+ grid-column: span $i;
12
+ }
11
13
  }
12
14
  }
13
15
  }
package/scss/grid.scss CHANGED
@@ -1,17 +1,19 @@
1
- .grid {
2
- display: grid;
3
- grid-template-columns: repeat(12, minmax(0, 1fr));
1
+ @layer utilities {
2
+ .grid {
3
+ display: grid;
4
+ grid-template-columns: repeat(12, minmax(0, 1fr));
4
5
 
5
- column-gap: 1rem;
6
- row-gap: 1rem;
7
- }
6
+ column-gap: 1rem;
7
+ row-gap: 1rem;
8
+ }
8
9
 
9
- .col {
10
- grid-column: span 12;
11
- }
10
+ .col {
11
+ grid-column: span 12;
12
+ }
12
13
 
13
- @for $i from 1 through 12 {
14
- .col-#{$i} {
15
- grid-column: span $i;
14
+ @for $i from 1 through 12 {
15
+ .col-#{$i} {
16
+ grid-column: span $i;
17
+ }
16
18
  }
17
19
  }
package/scss/index.scss CHANGED
@@ -1,15 +1,23 @@
1
+ @forward './reboot.scss';
1
2
  @forward './theme.scss';
2
3
  @forward './variables.scss';
3
- @forward './reboot.scss';
4
4
  @forward './typography.scss';
5
5
  @forward './text.scss';
6
+
6
7
  @forward './utilities.scss';
8
+
7
9
  @forward './spacings.scss';
8
10
  @forward './spacings-responsive.scss';
11
+
9
12
  @forward './flex.scss';
10
13
  @forward './flex-responsive.scss';
14
+
11
15
  @forward './grid.scss';
12
16
  @forward './grid-responsive.scss';
17
+
18
+ @forward './gap.scss';
19
+ @forward './gap-responsive.scss';
20
+
13
21
  @forward './borders.scss';
14
22
 
15
23
  @forward './components/breadcrumb.scss';