Skip to content

Commit 01c90ed

Browse files
committed
feat(navdrawer): allow setting border radius for navdrawer items
Closes #4964
1 parent d9523d1 commit 01c90ed

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

projects/igniteui-angular/src/lib/core/styles/components/navdrawer/_navdrawer-theme.scss

+15-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
/// @param {Color} $item-hover-text-color [null] - The item's hover text color.
2222
/// @param {Color} $item-hover-icon-color [null] - The item's hover icon color.
2323
/// @param {Color} $shadow [null] - Sets a custom shadow to be used by the drawer.
24-
/// @param {border-radius} $border-radius [null] - The border radius used for navdrawer item.
24+
/// @param {border-radius} $border-radius [null] - The border radius used for the navdrawer.
25+
/// @param {item-border-radius} $item-border-radius [null] - The border radius used for the navdrawer items.
2526
///
2627
/// @requires $default-palette
2728
/// @requires $light-schema
@@ -46,6 +47,7 @@
4647
$elevations: $elevations,
4748
4849
$border-radius: null,
50+
$item-border-radius: null,
4951
5052
$background: null,
5153
$border-color: null,
@@ -71,6 +73,10 @@
7173
if($border-radius, $border-radius, map-get($navdrawer-schema, 'border-radius')), 0, 36px
7274
);
7375

76+
$item-border-radius: round-borders(
77+
if($item-border-radius, $item-border-radius, map-get($navdrawer-schema, 'item-border-radius')), 0, 24px
78+
);
79+
7480
@if not($item-header-text-color) and $background {
7581
$item-header-text-color: text-contrast($background);
7682
}
@@ -116,6 +122,7 @@
116122
name: $name,
117123
palette: $palette,
118124
border-radius: $border-radius,
125+
item-border-radius: $item-border-radius,
119126
background: $background,
120127
border-color: $border-color,
121128
item-text-color:$item-text-color,
@@ -246,23 +253,23 @@
246253
display: flex;
247254
flex-flow: row nowrap;
248255
color: --var($theme, 'item-text-color');
249-
max-height: 48px;
250-
padding: 12px 16px;
256+
max-height: rem(48px);
257+
padding: rem(12px) rem(16px);
251258
cursor: pointer;
252259
align-items: center;
253260
user-select: none;
254261
outline: transparent;
255262
white-space: nowrap;
256-
border-radius: 4px;
257-
margin: 8px;
263+
border-radius: --var($theme, 'item-border-radius');
264+
margin: rem(8px);
258265

259266
> igx-icon + span {
260-
margin-left: 32px;
267+
margin-left: rem(32px);
261268
}
262269

263270
&[dir='rtl'] {
264271
> igx-icon + span {
265-
margin-right: 32px;
272+
margin-right: rem(32px);
266273
}
267274
}
268275

@@ -303,7 +310,7 @@
303310

304311
%item--header {
305312
display: block;
306-
padding: 12px 16px;
313+
padding: rem(12px) rem(16px);
307314
white-space: nowrap;
308315
color: --var($theme, 'item-header-text-color');
309316
}

projects/igniteui-angular/src/lib/core/styles/themes/schemas/light/_navdrawer.scss

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/// @prop {map} item-hover-icon-color [igx-color: 'surface', text-contrast: (), rgba: .87] - The item's hover icon color.
2121
/// @prop {map} elevation [16] - The elevation level of the drawer, between 0 - 24.
2222
/// @prop {Number} border-radius [0] - The border radius fraction, between 0-1 to be used for navdrawer component.
23+
/// @prop {Number} item-border-radius [0] - The border radius fraction, between 0-1 to be used for navdrawer items.
2324
///
2425
/// @see $default-palette
2526

@@ -30,6 +31,8 @@ $_light-navdrawer: (
3031

3132
border-radius: 0,
3233

34+
item-border-radius: .16667,
35+
3336
border-color: rgba(0, 0, 0, .14),
3437

3538
item-header-text-color: (

0 commit comments

Comments
 (0)