From 962c76503e1d5fabff9a0dc29e8577ad609cbd2c Mon Sep 17 00:00:00 2001 From: Adrian Schmidt Date: Thu, 10 Jan 2019 16:02:52 +0100 Subject: [PATCH] fix(limel-menu): decrease size of text and icons re Lundalogik/crm-feature#704 fix #210 --- src/components/list/list-renderer.tsx | 7 ++++--- src/components/menu/menu.scss | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/list/list-renderer.tsx b/src/components/list/list-renderer.tsx index d4de08363f..150a6335f5 100644 --- a/src/components/list/list-renderer.tsx +++ b/src/components/list/list-renderer.tsx @@ -76,7 +76,7 @@ export class ListRenderer { aria-disabled={item.disabled ? 'true' : 'false'} data-index={index} > - {item.icon ? this.renderIcon(item) : null} + {item.icon ? this.renderIcon(config, item) : null} {this.renderText(item.text, item.secondaryText)} ); @@ -108,11 +108,12 @@ export class ListRenderer { /** * Render an icon for a list item * + * @param {ListRendererConfig} config the config object, passed on from the `renderListItem` function * @param {ListItem} item the list item * * @returns {HTMLElement} the icon element */ - private renderIcon(item: ListItem) { + private renderIcon(config: ListRendererConfig, item: ListItem) { const style = {}; if (item.iconColor) { style['--icon-background-color'] = item.iconColor; @@ -123,7 +124,7 @@ export class ListRenderer { class="mdc-list-item__graphic" name={item.icon} style={style} - size="medium" + size={config.isMenu ? 'small' : 'medium'} /> ); } diff --git a/src/components/menu/menu.scss b/src/components/menu/menu.scss index 9e40de678d..910cab3efd 100644 --- a/src/components/menu/menu.scss +++ b/src/components/menu/menu.scss @@ -27,3 +27,11 @@ $menu-item-background-color: #ebebeb; } } } + +.mdc-list-item[role="menuitem"] { + font-size: 1.3rem; + + .mdc-list-item__graphic { + margin-right: 1.4rem; + } +}