Skip to content

Commit

Permalink
Merge pull request #7326 from slavanga/develop
Browse files Browse the repository at this point in the history
Simplify expanded menus
  • Loading branch information
gakimball committed Dec 18, 2015
2 parents dd0be69 + a566173 commit 8d416ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
18 changes: 11 additions & 7 deletions scss/components/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@ $buttongroup-expand-max: 6 !default;
/// @param {Keyword|Number} $count [auto] - Number of buttons inside the button group. Set to `auto` to generate CSS that will account for a variable number of buttons.
/// @param {String} $selector [$buttongroup-child-selector] - Selector for the buttons inside a button group.
@mixin button-group-expand(
$count: auto,
$selector: $buttongroup-child-selector
) {
display: table;
table-layout: fixed;
width: 100%;

&::before,
&::after {
display: none;
}

#{$selector} {
@if $count == auto {
@include auto-width($buttongroup-expand-max, $selector);
}
@else if type-of($count) == 'number' {
width: percentage(1 / $count);
}
display: table-cell;
float: none;
}
}

Expand Down
13 changes: 2 additions & 11 deletions scss/components/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,10 @@ $menu-expand-max: 6 !default;
}

/// Expands the items of a Menu, so each item is the same width.
/// @param {Keyword|Number} $count [auto] - Number of items in the Menu. You can hardcode a number, or use `auto` to generate CSS that will adapt to the number of items inside the menu.
@mixin menu-expand($count: auto) {
@mixin menu-expand {
display: table;
table-layout: fixed;
width: 100%;

> li {
@if $count == auto {
@include auto-width($menu-expand-max);
}
@else if type-of($count) == 'number' {
width: percentage(1 / $count);
}
}
}

/// Sets the direction of a Menu.
Expand Down

0 comments on commit 8d416ea

Please sign in to comment.