Skip to content

Commit 82954e0

Browse files
committed
refactor(toolbar): update element offsets in theme
1 parent 34e52e1 commit 82954e0

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

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

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@
9292
));
9393
}
9494

95+
@mixin _offset-sibling-elements($offset) {
96+
+ igx-grid-header-row,
97+
+ igx-grid-group-by-area {
98+
margin-top: $offset;
99+
}
100+
101+
+ igx-grid-group-by-area {
102+
height: auto;
103+
}
104+
}
105+
95106
/// @param {Map} $theme - The theme used to style the component.
96107
@mixin grid-toolbar($theme) {
97108
@include css-vars($theme);
@@ -121,6 +132,9 @@
121132
);
122133

123134
%igx-grid-toolbar {
135+
$height: map.get($grid-toolbar-height, 'comfortable');
136+
@include _offset-sibling-elements($height);
137+
124138
position: absolute;
125139
width: 100%;
126140
display: flex;
@@ -137,7 +151,7 @@
137151

138152
background: var-get($theme, 'background-color');
139153
height: auto;
140-
min-height: map.get($grid-toolbar-height, 'comfortable');
154+
min-height: $height;
141155
padding-block: 0;
142156
padding-inline: map.get($grid-toolbar-padding, 'comfortable');
143157

@@ -165,52 +179,30 @@
165179
}
166180
}
167181
}
168-
169-
+ igx-grid-header-row {
170-
margin-top: map.get($grid-toolbar-height, 'comfortable');
171-
}
172-
173-
+ igx-grid-group-by-area {
174-
margin-top: map.get($grid-toolbar-height, 'comfortable');
175-
height: auto;
176-
}
177182
}
178183

179-
180184
%igx-grid-toolbar--cosy {
181-
min-height: map.get($grid-toolbar-height, 'cosy');
185+
$height: map.get($grid-toolbar-height, 'cosy');
186+
@include _offset-sibling-elements($height);
187+
188+
min-height: $height;
182189
padding-inline: map.get($grid-toolbar-padding, 'cosy');
183190

184191
[igxButton] {
185192
margin-inline-start: map.get($grid-toolbar-spacer, 'cosy');
186193
}
187-
188-
+ igx-grid-header-row {
189-
margin-top: map.get($grid-toolbar-height, 'cosy');
190-
}
191-
192-
+ igx-grid-group-by-area {
193-
margin-top: map.get($grid-toolbar-height, 'cosy');
194-
height: auto;
195-
}
196194
}
197195

198196
%igx-grid-toolbar--compact {
199-
min-height: map.get($grid-toolbar-height, 'compact');
197+
$height: map.get($grid-toolbar-height, 'compact');
198+
@include _offset-sibling-elements($height);
199+
200+
min-height: $height;
200201
padding-inline: map.get($grid-toolbar-padding, 'compact');
201202

202203
[igxButton] {
203204
margin-inline-start: map.get($grid-toolbar-spacer, 'compact');
204205
}
205-
206-
+ igx-grid-header-row {
207-
margin-top: map.get($grid-toolbar-height, 'compact');
208-
}
209-
210-
+ igx-grid-group-by-area {
211-
margin-top: map.get($grid-toolbar-height, 'compact');
212-
height: auto;
213-
}
214206
}
215207

216208
%igx-grid-toolbar__title {

0 commit comments

Comments
 (0)