# sidebar-style-guide [](https://badge.fury.io/js/sidebar-style-guide) A style guide (CSS and Sass) providing a convenient base for styling common sidebar/drawer elements like menus, brand, etc. This package complements the [drawer](https://github.com/themekit/material-design-kit/tree/master/src/drawer) component from [material-design-kit](https://github.com/themekit/material-design-kit). ## Installation Install sidebar-style-guide via npm. ```bash npm install sidebar-style-guide ``` ## Usage ```sass // Customize variables $sidebar-font-size: 16px !default; @import 'node_modules/sidebar-style-guide/sass/variables'; @import 'node_modules/sidebar-style-guide/sass/style'; ``` ## Sidebar skins There are two base skin variants that you get out of the box for making a sidebar with a light background color and dark text color or a sidebar with dark background color and light text color.
| CSS Class | Description |
|---|---|
.sidebar-light |
Defines the basic style for a sidebar with a light background color and dark text color. |
.sidebar-dark |
Defines the basic style for a sidebar with a dark background color and light text color. |
| CSS Class | Description |
|---|---|
.sidebar-left |
Applies style on a sidebar positioned to the left |
.sidebar-right |
Applies style on a sidebar positioned to the right |
| CSS Class | Description |
|---|---|
.sidebar-menu |
The sidebar menu wrapper ul |
.sidebar-menu-item |
The sidebar menu item li |
.sidebar-menu-button |
The sidebar menu button a |
| Sass variable | Description | Default value |
|---|---|---|
$sm-spacing-x |
Defines the horizontal spacing for sidebar menus | $sidebar-spacing-x |
$sm-spacing-y |
Defines the vertical spacing for sidebar menus | $sidebar-spacing-y |
| Sass variable | Description | Default value |
|---|---|---|
$sm-button-font-size |
Defines the base font size in px for .sidebar-menu-button |
$sidebar-font-size |
$sm-button-font-weight |
Defines the font weight for .sidebar-menu-button |
400 |
$sm-button-height |
Defines the height in px for .sidebar-menu-button |
42px |
$sm-active-button-font-weight |
Defines the font weight for .sidebar-menu-button when using li.sidebar-menu-item.active |
$sm-button-font-weight |
| CSS Class | Description |
|---|---|
.sidebar-menu-icon |
The sidebar menu icon |
.material-icons |
Required on .sidebar-menu-icon elements when using Material icons |
| Sass variable | Description | Default value |
|---|---|---|
$sm-icon-font-size |
Defines the base font size in px for sidebar menu icons |
24px |
$sm-icon-margin |
Defines the margin for sidebar menu icons | $sm-spacing-x * 0.4 |
| CSS Class | Description |
|---|---|
.sm-condensed |
Applies a smaller spacing to sidebar menu buttons |
.sm-bordered |
Applies a border bottom to a .sidebar-menu or .sidebar-submenu |
.sm-item-bordered |
Applies a border bottom to .sidebar-menu or .sidebar-submenu items |
.sm-active-button-bg |
Applies a background color to active sidebar menu items |
.sm-icons-right |
Aligns the sidebar menu icons to the right |
.sm-icons-block |
Wrap the sidebar menu icons into a square block with background color |
.sm-indent |
Increase the horizontal spacing of .sidebar-menu or .sidebar-submenu buttons |
| Sass variable | Description | Default value |
|---|---|---|
$sm-condensed-button-height |
Defines the height in px for sidebar menu buttons when using .sm-condensed |
$sm-button-height - ($sm-button-height/4) |
$ssm-condensed-button-height |
Defines the height in px for sidebar submenu buttons when using .sm-condensed |
$ssm-button-height - ($ssm-button-height/4) |
| Sass variable | Description | Default value |
|---|---|---|
$sidebar-dark-border-color |
Defines the default border color for sidebar elements when using the .sidebar-dark skin |
rgba(0, 0, 0, .15) |
$sidebar-light-border-color |
Defines the default border color for sidebar elements when using the .sidebar-light skin |
#e5e5e5 |
| Sass variable | Description | Default value |
|---|---|---|
$sm-dark-item-border-color |
Defines the border color for sidebar menu items when using the .sidebar-dark skin |
$sidebar-dark-border-color |
$ssm-dark-item-border-color |
Defines the border color for sidebar submenu items when using the .sidebar-dark skin |
$sm-dark-item-border-color |
$sm-light-item-border-color |
Defines the border color for sidebar menu items when using the .sidebar-light skin |
$sidebar-light-border-color |
$ssm-light-item-border-color |
Defines the border color for sidebar submenu items when using the .sidebar-light skin |
$sm-light-item-border-color |
| Sass variable | Description | Default value |
|---|---|---|
$sm-dark-active-button-bg |
Defines the background color for active sidebar menu buttons when using the .sidebar-dark skin |
rgba(255, 255, 255, .12) |
$sm-dark-activebuttonbg-button-color |
Defines the text color for active sidebar menu buttons when using the .sidebar-dark skin |
#fff |
$sm-dark-activebuttonbg-icon-color |
Defines the icon text color for active sidebar menu buttons when using the .sidebar-dark skin |
$sm-dark-activebuttonbg-button-color |
$sm-light-active-button-bg |
Defines the background color for active sidebar menu buttons when using the .sidebar-light skin |
$brand-primary |
$sm-light-activebuttonbg-button-color |
Defines the text color for active sidebar menu buttons when using the .sidebar-light skin |
#fff |
$sm-light-activebuttonbg-icon-color |
Defines the icon text color for active sidebar menu buttons when using the .sidebar-light skin |
$sm-light-activebuttonbg-button-color |
| Sass variable | Description | Default value |
|---|---|---|
$sm-dark-active-iconsblock-activebuttonbg-icon-bg |
Defines the icon background color for active sidebar menu buttons when using the .sidebar-dark skin |
$sm-dark-active-iconsblock-icon-bg |
$sm-light-active-iconsblock-activebuttonbg-icon-bg |
Defines the icon background color for active sidebar menu buttons when using the .sidebar-light skin |
$sm-light-active-iconsblock-icon-bg |
| CSS Class | Description |
|---|---|
.sidebar-submenu |
The sidebar submenu wrapper ul placed after a.sidebar-menu-button elements |
.sidebar-menu-item |
The sidebar submenu item li |
.sidebar-menu-button |
The sidebar submenu button a |
.open |
Makes the sidebar submenu visible when applied to a li.sidebar-menu-item parent |
| Sass variable | Description | Default value |
|---|---|---|
$ssm-button-height |
Defines the height in px for sidebar submenu buttons |
$sm-button-height |
$ssm-button-font-size |
Defines the base font size in px for sidebar submenu buttons |
$sm-button-font-size |
| Sass variable | Description | Default value |
|---|---|---|
$ssm-icon-font-size |
Defines the base font size in px for sidebar submenu icons |
$sm-icon-font-size |