Skip to content

Commit c6ee393

Browse files
vanilla-thunderncoden
authored andcommitted
Use pull request foundation#11354 from vanilla-thunder/feat/pick-active-menu-item-color-by-contrast for v6.5.0
3568b10 automatically pick active menu item text color Signed-off-by: Nicolas Coden <[email protected]>
1 parent 6a7343b commit c6ee393

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

scss/components/_menu.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ $menu-simple-margin: 1rem !default;
2626
/// @type Color
2727
$menu-item-color-active: $white !default;
2828

29+
/// Alternative text color of an active menu item..
30+
/// @type Color
31+
$menu-item-color-alt-active: $black !default;
32+
2933
/// Background color of an active menu item.
3034
/// @type Color
3135
$menu-item-background-active: get-color(primary) !default;
@@ -350,7 +354,7 @@ $menu-icons-back-compat: true !default;
350354

351355
@mixin menu-state-active {
352356
background: $menu-item-background-active;
353-
color: $menu-item-color-active;
357+
color: color-pick-contrast($menu-item-background-active, ($menu-item-color-active, $menu-item-color-alt-active));
354358
}
355359

356360
@mixin foundation-menu {

scss/settings/_settings.scss

+1
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ $menu-nested-margin: $global-menu-nested-margin;
474474
$menu-items-padding: $global-menu-padding;
475475
$menu-simple-margin: 1rem;
476476
$menu-item-color-active: $white;
477+
$menu-item-color-alt-active: $black;
477478
$menu-item-background-active: get-color(primary);
478479
$menu-icon-spacing: 0.25rem;
479480
$menu-state-back-compat: true;

0 commit comments

Comments
 (0)