Skip to content

Commit e2abcbf

Browse files
refactor(grid): use spacing for padding and margin (#11446)
* refactor(grid): use spacing for margin and padding Co-authored-by: Marin Popov <[email protected]>
1 parent 8b405c2 commit e2abcbf

File tree

6 files changed

+180
-177
lines changed

6 files changed

+180
-177
lines changed

projects/igniteui-angular/src/lib/core/styles/components/grid-summary/_grid-summary-theme.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@
108108
);
109109

110110
$item-padding: (
111-
comfortable: rem(6px) 0,
112-
cosy: rem(2px) 0,
111+
comfortable: spacing(6px, 'comfortable') 0,
112+
cosy: spacing(2px, 'cosy') 0,
113113
compact: 0
114114
);
115115

116116
$summary-padding: (
117-
comfortable: 0 rem(24px),
118-
cosy: 0 rem(16px),
119-
compact: 0 rem(12px)
117+
comfortable: 0 spacing(24px, 'comfortable'),
118+
cosy: 0 spacing(16px, 'cosy'),
119+
compact: 0 spacing(12px, 'compact')
120120
);
121121

122122
%igx-grid-summary {
@@ -189,7 +189,7 @@
189189
%igx-grid-summary__label {
190190
color: var-get($theme, 'label-color');
191191
min-width: rem(30px);
192-
margin-inline-end: rem(3px);
192+
margin-inline-end: spacing(3px);
193193

194194
&:hover {
195195
color: var-get($theme, 'label-hover-color');

projects/igniteui-angular/src/lib/core/styles/components/grid-toolbar/_grid-toolbar-theme.scss

+7-7
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@
119119
$grid-toolbar-fs: rem(16px);
120120

121121
$grid-toolbar-padding: (
122-
comfortable: rem(16px) rem(24px),
123-
cosy: rem(12px) rem(16px),
124-
compact: rem(8px) rem(12px)
122+
comfortable: spacing(16px, 'comfortable') spacing(24px, 'comfortable'),
123+
cosy: spacing(12px, 'cosy') spacing(16px, 'cosy'),
124+
compact: spacing(8px, 'compact') spacing(12px, 'compact')
125125
);
126126

127127
$grid-toolbar-spacer: (
128-
comfortable: rem(16px),
129-
cosy: rem(12px),
130-
compact: rem(8px)
128+
comfortable: spacing(16px, 'comfortable'),
129+
cosy: spacing(12px, 'cosy'),
130+
compact: spacing(8px, 'compact')
131131
);
132132

133133
$grid-toolbar-height: (
@@ -297,7 +297,7 @@
297297
%igx-grid-toolbar__dd-list-items {
298298
cursor: pointer;
299299
position: relative;
300-
padding: em(8px) em(16px);
300+
padding: spacing(8px) spacing(16px);
301301
color: var-get($theme, 'item-text-color');
302302
white-space: nowrap;
303303

projects/igniteui-angular/src/lib/core/styles/components/grid/_advanced-filtering-theme.scss

+22-22
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
$not-bootstrap-theme: $variant != 'bootstrap';
1919
$bootstrap-theme: $variant == 'bootstrap';
2020

21-
$vertical-space-comfortable: rem(16px);
22-
$vertical-space-cosy: rem(12px);
23-
$vertical-space-compact: rem(8px);
24-
$horizontal-space-comfortable: rem(16px);
25-
$horizontal-space-cosy: rem(12px);
26-
$horizontal-space-compact: rem(8px);
21+
$vertical-space-comfortable: spacing(16px, 'comfortable');
22+
$vertical-space-cosy: spacing(12px, 'cosy');
23+
$vertical-space-compact: spacing(8px, 'compact');
24+
$horizontal-space-comfortable: spacing(16px, 'comfortable');
25+
$horizontal-space-cosy: spacing(12px, 'cosy');
26+
$horizontal-space-compact: spacing(8px, 'compact');
2727

2828
$bootstrap-theme: $variant == 'bootstrap';
2929

@@ -59,13 +59,13 @@
5959

6060
%advanced-filter__main {
6161
display: block;
62-
padding: rem(16px);
62+
padding: spacing(16px);
6363
overflow: auto;
6464
min-height: 214px;
6565
max-height: 468px;
6666

6767
[igxButton] + [igxButton] {
68-
margin-inline-start: rem(8px);
68+
margin-inline-start: spacing(8px);
6969
}
7070
}
7171

@@ -74,7 +74,7 @@
7474
width: rem(18px);
7575
height: rem(18px);
7676
font-size: rem(18px);
77-
margin-inline-end: rem(8px);
77+
margin-inline-end: spacing(8px);
7878
}
7979
}
8080

@@ -141,12 +141,12 @@
141141
}
142142

143143
%filter-tree__expression-column {
144-
padding: 0 rem(8px);
144+
padding: 0 spacing(8px);
145145
}
146146

147147
%filter-tree__expression-actions {
148148
display: inline-flex;
149-
margin: 0 rem(8px);
149+
margin: 0 spacing(8px);
150150

151151
igx-icon {
152152
cursor: pointer;
@@ -160,7 +160,7 @@
160160
}
161161

162162
igx-icon + igx-icon {
163-
margin-inline-start: rem(8px);
163+
margin-inline-start: spacing(8px);
164164
}
165165
}
166166

@@ -189,7 +189,7 @@
189189
igx-select + igx-input-group,
190190
igx-select + igx-date-picker,
191191
igx-input-group + igx-select {
192-
margin-inline-start: rem(8px);
192+
margin-inline-start: spacing(8px);
193193
}
194194

195195
+ %filter-tree,
@@ -200,15 +200,15 @@
200200

201201
%filter-tree__inputs-actions {
202202
display: flex;
203-
margin: 0 rem(8px);
203+
margin: 0 spacing(8px);
204204
align-items: center;
205205

206206
[igxButton] {
207207
transition: none;
208208
}
209209

210210
[igxButton] + [igxButton] {
211-
margin-inline-start: rem(8px);
211+
margin-inline-start: spacing(8px);
212212
}
213213
}
214214

@@ -230,11 +230,11 @@
230230
height: rem(24px);
231231
background: white;
232232
border-radius: border-radius(rem(4px));
233-
margin-inline-end: rem(8px);
233+
margin-inline-end: spacing(8px);
234234
}
235235

236236
+ %filter-legend__item {
237-
margin-inline-start: rem(24px);
237+
margin-inline-start: spacing(24px);
238238
}
239239
}
240240

@@ -252,8 +252,8 @@
252252
flex-flow: column;
253253
width: 196px;
254254
background-color: var-get($theme, 'filtering-row-background');
255-
padding: rem(16px);
256-
margin-inline-start: rem(16px);
255+
padding: spacing(16px);
256+
margin-inline-start: spacing(16px);
257257
border-radius: border-radius(rem(4px));
258258
border: 1px solid color($palette, 'grays', 200);
259259

@@ -269,7 +269,7 @@
269269
}
270270

271271
[igxButton] > igx-icon + * {
272-
margin-inline-start: 8px;
272+
margin-inline-start: spacing(8px);
273273
}
274274

275275
igx-buttongroup > * {
@@ -333,7 +333,7 @@
333333

334334
%advanced-filter__main,
335335
%advanced-filter__header {
336-
padding: $vertical-space-cosy rem(16px);
336+
padding: $vertical-space-cosy spacing(16px, 'cosy');
337337
}
338338

339339
%filter-tree__expression-actions igx-icon {
@@ -392,7 +392,7 @@
392392

393393
%advanced-filter__main,
394394
%advanced-filter__header {
395-
padding: $vertical-space-compact rem(16px);
395+
padding: $vertical-space-compact spacing(16px, 'compact');
396396
}
397397

398398
%filter-tree__expression-actions igx-icon {

0 commit comments

Comments
 (0)