Menu Group
Installation
yarn add @chewy/kib-menus-styles
Import
@use '~@chewy/kib-menus-styles/src/kib-menu-group/styles' as kib-menu-group;
Mixins
menu-group-link
@mixin menu-group-link() { ... }
@mixin menu-group-link() { @include typography.style-as('paragraph-1'); padding-left: spacing.get('s8'); padding-right: spacing.get('s4'); display: flex; align-items: center; justify-content: flex-start; background-color: settings.$background-color; border: settings.$border-width solid settings.$border-color; height: settings.$height; transition: border-color 200ms, background-color 200ms; text-decoration: none; &, &:visited { color: settings.$text-color; } &:hover { color: settings.$text-color-hover; background-color: settings.$background-color-hover; text-decoration: none; } &:focus { border-color: settings.$border-color-focus; outline: none; } &:active { background-color: settings.$background-color-active; } &--current { font-weight: typography.get-weight('semibold'); } }
Description
Menu group link styles
Parameters
None.
Requires
- [function]
get
- [function]
get-weight
- [variable]
background-color
- [variable]
border-width
- [variable]
border-color
- [variable]
height
- [variable]
text-color
- [variable]
text-color-hover
- [variable]
background-color-hover
- [variable]
border-color-focus
- [variable]
background-color-active
Author
CDS
menu-group-link-label
@mixin menu-group-link-label() { ... }
@mixin menu-group-link-label() { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
Description
Menu group link text label styles
Parameters
None.
Author
CDS
menu-group-toggle
@mixin menu-group-toggle() { ... }
@mixin menu-group-toggle() { @include typography.style-as('paragraph-1'); padding: 0 spacing.get('s4'); display: block; width: 100%; background-color: settings.$group-toggle-background; border: none; cursor: pointer; height: settings.$group-toggle-height; text-align: left; transition: background-color 200ms; &, &:hover { color: settings.$group-toggle-text-color; } &:hover { background-color: settings.$group-toggle-background-hover; } &:focus { background-color: settings.$group-toggle-background-focus; outline: none; } &:active { background-color: settings.$group-toggle-background-active; } }
Description
Menu group toggle button styles
Parameters
None.
Requires
- [function]
get
- [variable]
group-toggle-background
- [variable]
group-toggle-height
- [variable]
group-toggle-text-color
- [variable]
group-toggle-background-hover
- [variable]
group-toggle-background-focus
- [variable]
group-toggle-background-active
Author
CDS
fade-transition
@mixin fade-transition() { ... }
@mixin fade-transition() { animation-name: kibMenusGroupCollapse; animation-duration: 0.2s; // stylelint-disable-next-line keyframes-name-pattern @keyframes kibMenusGroupCollapse { from { height: 0; opacity: 0; } to { opacity: 1; height: max-content; } } }
Description
Menu Group List open/close transition
Parameters
None.
TODO's
This style is just a placeholder until we have react transition component ready
Author
CDS
Variables
border-width
$border-width: unit.rem(1px) !default;
Description
Menu link border width
Type
Number
Author
CDS
text-color
$text-color: color.get('menu', 'alternate', 'active', 'text') !default;
Description
Menu link text color
Type
Color
Author
CDS
text-color-hover
$text-color-hover: $text-color !default;
background-color
$background-color: transparent !default;
Description
Menu link background color
Type
Color
Author
CDS
background-color-hover
$background-color-hover: color.get('menu', 'alternate', 'hover', 'primary') !default;
Description
Menu link background color on hover
Type
Color
Author
CDS
background-color-active
$background-color-active: color.get('menu', 'alternate', 'pressed', 'primary') !default;
background-color-current
$background-color-current: $background-color !default;
Description
Menu link background color when active
Type
Color
Author
CDS
border-color
$border-color: transparent !default;
Description
Menu link border color
Type
Color
Author
CDS
border-color-focus
$border-color-focus: color.get('menu', 'alternate', 'focused', 'border') !default;
Description
Menu link border color on focus
Type
Color
Author
CDS
height
$height: kib-core.dimensions-get('huge') !default;
Description
Menu link height
Type
Number
Author
CDS
group-toggle-text-color
$group-toggle-text-color: color.get('menu', 'alternate', 'active', 'text') !default;
group-toggle-background
$group-toggle-background: transparent !default;
group-toggle-background-hover
$group-toggle-background-hover: color.get('menu', 'alternate', 'hover', 'primary') !default;
Description
Menu group toggle background color on hover state
Type
Color
Used by
- [mixin]
menu-group-toggle
Author
CDS
group-toggle-background-focus
$group-toggle-background-focus: color.get('menu', 'alternate', 'selected', 'primary') !default;
Description
Menu group toggle background color on focus state
Type
Color
Used by
- [mixin]
menu-group-toggle
Author
CDS
group-toggle-background-active
$group-toggle-background-active: color.get('menu', 'alternate', 'pressed', 'primary') !default;
Description
Menu group toggle background color on active state
Type
Color
Used by
- [mixin]
menu-group-toggle
Author
CDS
group-toggle-height
$group-toggle-height: kib-core.dimensions-get('huge') !default;