From a2049feddfb14efb8bb647b7a17b85c7cb08ca66 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 14 May 2015 22:24:59 +0930 Subject: [PATCH] Only give dropdown menu items padding if they have an icon --- .../core/js/lib/components/action-button.js | 2 +- framework/core/less/lib/dropdowns.less | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/framework/core/js/lib/components/action-button.js b/framework/core/js/lib/components/action-button.js index 8c03e6cc4..505d600cb 100644 --- a/framework/core/js/lib/components/action-button.js +++ b/framework/core/js/lib/components/action-button.js @@ -13,7 +13,7 @@ export default class ActionButton extends Component { delete attrs.label; attrs.href = attrs.href || 'javascript:;'; - return m('a', attrs, [ + return m('a'+(iconName ? '.has-icon' : ''), attrs, [ iconName ? icon(iconName+' icon') : '', m('span.label', label) ]); diff --git a/framework/core/less/lib/dropdowns.less b/framework/core/less/lib/dropdowns.less index b3e923b19..0751a826d 100644 --- a/framework/core/less/lib/dropdowns.less +++ b/framework/core/less/lib/dropdowns.less @@ -6,13 +6,21 @@ color: @fl-body-color; .box-shadow(0 2px 6px @fl-shadow-color); + & > li > a:hover, + & > li > a:focus, + & > .active > a, + & > .active > a:hover, + & > .active > a:focus { + color: @fl-body-color; + background-color: @fl-body-control-bg; + } + & > li > a { - padding: 8px 15px 8px 40px; + padding: 8px 15px; color: @fl-body-color; - &:hover, &:focus { - color: @fl-body-color; - background-color: @fl-body-control-bg; + &.has-icon { + padding-left: 40px; } &.disabled { color: #aaa;