@nice-digital/nds-grid 1.2.20-alpha.0 → 2.0.2-alpha.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.
- package/package.json +3 -3
- package/scss/grid.scss +12 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-grid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2-alpha.0",
|
|
4
4
|
"description": "Grid component for the NICE Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"grid"
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nice-digital/nds-core": "^
|
|
40
|
+
"@nice-digital/nds-core": "^2.0.2-alpha.0",
|
|
41
41
|
"classnames": "^2.2.6",
|
|
42
42
|
"prop-types": "^15.7.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^16 || ^17 || ^18"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "04839cc13ae0a0fbd0baeefff5996943285dafab"
|
|
48
48
|
}
|
package/scss/grid.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use 'sass:math';
|
|
2
2
|
@use '@nice-digital/nds-core/scss/colours';
|
|
3
3
|
@use '@nice-digital/nds-core/scss/media-queries';
|
|
4
4
|
@use '@nice-digital/nds-core/scss/spacing';
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
.grid {
|
|
32
32
|
--nds-grid-gutter: #{grid-settings.$grid-gutter};
|
|
33
33
|
display: flex;
|
|
34
|
-
flex-
|
|
35
|
-
flex-wrap: wrap;
|
|
34
|
+
flex-flow: row wrap;
|
|
36
35
|
justify-content: flex-start;
|
|
37
36
|
list-style: none; // Allow the grid system to be used on lists.
|
|
38
37
|
margin-left: -#{grid-settings.$grid-gutter * 0.5};
|
|
@@ -120,6 +119,7 @@
|
|
|
120
119
|
margin-left: #{grid-settings.$grid-gutter * 0.5};
|
|
121
120
|
margin-right: #{grid-settings.$grid-gutter * 0.5};
|
|
122
121
|
position: relative;
|
|
122
|
+
|
|
123
123
|
// Fixed gutters fallback for IE11, due to lack of custom property support:
|
|
124
124
|
width: calc(100% - #{grid-settings.$grid-gutter});
|
|
125
125
|
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
--grid-item-width: 100%;
|
|
128
128
|
margin-left: calc(var(--nds-grid-gutter) / 2) !important;
|
|
129
129
|
margin-right: calc(var(--nds-grid-gutter) / 2) !important;
|
|
130
|
+
|
|
130
131
|
// Slightly hacky 0.1px because of subpixel rounding e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1323735
|
|
131
132
|
width: calc(
|
|
132
133
|
var(--grid-item-width) - var(--nds-grid-gutter) - 0.1px
|
|
@@ -153,33 +154,34 @@
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
@mixin
|
|
157
|
+
@mixin -nds-generate-grid-items($prefix: null) {
|
|
157
158
|
$prefix: if($prefix, $prefix + ':', '');
|
|
158
159
|
|
|
159
160
|
@for $index from 1 through 12 {
|
|
160
161
|
[data-g~='#{ $prefix }#{ $index }'] {
|
|
161
|
-
--grid-item-width: #{percentage(math.div($index, 12))};
|
|
162
|
+
--grid-item-width: #{math.percentage(math.div($index, 12))};
|
|
163
|
+
|
|
162
164
|
// IE 11 fallback, due to lack of custom property support:
|
|
163
165
|
width: calc(
|
|
164
|
-
#{percentage(math.div($index, 12))} - #{grid-settings.$grid-gutter}
|
|
166
|
+
#{math.percentage(math.div($index, 12))} - #{grid-settings.$grid-gutter}
|
|
165
167
|
);
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
@for $index from 0 through 12 {
|
|
170
172
|
[data-g~='#{ $prefix }push:#{ $index }'] {
|
|
171
|
-
left: percentage(math.div($index, 12));
|
|
173
|
+
left: math.percentage(math.div($index, 12));
|
|
172
174
|
}
|
|
173
175
|
[data-g~='#{ $prefix }pull:#{ $index }'] {
|
|
174
|
-
right: percentage(math.div($index, 12));
|
|
176
|
+
right: math.percentage(math.div($index, 12));
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
|
|
179
|
-
@include
|
|
181
|
+
@include -nds-generate-grid-items;
|
|
180
182
|
|
|
181
183
|
@each $brkpnt-key, $brkpnt-value in media-queries.$breakpoints {
|
|
182
184
|
@include media-queries.mq($from: $brkpnt-key) {
|
|
183
|
-
@include
|
|
185
|
+
@include -nds-generate-grid-items($brkpnt-key);
|
|
184
186
|
}
|
|
185
187
|
}
|