Skip to content

Commit 1c2bdd2

Browse files
author
MPopov
committed
style(drop-down): Aadding classes for different density types
Closes #2960
1 parent cb45c3e commit 1c2bdd2

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

projects/igniteui-angular/src/lib/core/styles/components/drop-down/_drop-down-component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
@extend %igx-drop-down__header--cosy !optional;
5757
}
5858

59-
@include e(header, $m: cosy) {
59+
@include e(header, $m: compact) {
6060
@extend %igx-drop-down__header--compact !optional;
6161
}
6262

projects/igniteui-angular/src/lib/core/styles/components/drop-down/_drop-down-theme.scss

+30-11
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,18 @@
184184
$item-height: (
185185
confortable: rem(48px),
186186
cosy: rem(32px),
187-
compoact: rem(24px)
187+
compact: rem(24px)
188188
);
189189

190-
$item-padding: 16px;
191-
$desktop-header-padding: 16px;
192-
$mobile-header-padding: 8px;
190+
$item-padding-confortable:rem(16px);
191+
$item-padding-cosy:rem(8px);
192+
$item-padding-compact:rem(16px);
193+
194+
$item-padding: (
195+
confortable: 0 $item-padding-confortable,
196+
cosy: 0 $item-padding-cosy,
197+
compact: 0 $item-padding-compact
198+
);
193199

194200
%igx-drop-down {
195201
max-height: 100%;
@@ -214,10 +220,6 @@
214220
}
215221
}
216222

217-
%igx-drop-down__list--select {
218-
max-width: calc(100% + #{$item-padding} * 2);
219-
}
220-
221223
%igx-drop-down__header,
222224
%igx-drop-down__item {
223225
display: flex;
@@ -230,16 +232,30 @@
230232

231233
%igx-drop-down__item--cosy {
232234
height: map-get($item-height, 'cosy');
235+
padding: map-get($item-padding, 'cosy');
236+
//
237+
//&%igx-drop-down__list--select {
238+
// max-width: calc(100% + #{$item-padding-cosy} * 2);
239+
//}
233240
}
234241

235242
%igx-drop-down__item--compact {
236243
height: map-get($item-height, 'compact');
244+
padding: map-get($item-padding, 'compact');
245+
//
246+
//&%igx-drop-down__list--select {
247+
// max-width: calc(100% + #{$item-padding-compact} * 2);
248+
//}
237249
}
238250

239251
%igx-drop-down__item {
240252
color: --var($theme, 'item-text-color');
241253
cursor: pointer;
242-
padding: 0 rem($item-padding);
254+
padding: map-get($item-padding, 'confortable');
255+
256+
//&%igx-drop-down__list--select {
257+
// max-width: calc(100% + #{$item-padding-confortable} * 2);
258+
//}
243259

244260
&:focus {
245261
outline: 0;
@@ -264,15 +280,18 @@
264280
%igx-drop-down__header {
265281
color: --var($theme, 'header-text-color');
266282
pointer-events: none;
267-
padding: rem(8px) rem($desktop-header-padding);
283+
padding: map-get($item-padding, 'confortable');
268284
}
269285

270286
%igx-drop-down__header--cosy {
271287
height: map-get($item-height, 'cosy');
288+
padding: map-get($item-padding, 'confortable');
289+
272290
}
273291

274292
%igx-drop-down__header--compact {
275293
height: map-get($item-height, 'compact');
294+
padding: map-get($item-padding, 'confortable');
276295
}
277296

278297
%igx-drop-down__group {
@@ -283,7 +302,7 @@
283302
}
284303

285304
%igx-drop-down__item {
286-
text-indent: rem($desktop-header-padding);
305+
text-indent: map-get($item-padding, 'confortable') ;
287306
}
288307
}
289308

0 commit comments

Comments
 (0)