Skip to content

Commit

Permalink
Refactored only-child .button-group rules
Browse files Browse the repository at this point in the history
  • Loading branch information
patheard committed Feb 14, 2013
1 parent 0973127 commit 9bfa57c
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions src/grids/sass/includes/_button.scss
Expand Up @@ -111,9 +111,15 @@
z-index: 2;
}
}
> .button {
&:first-child { @include border-left-radius(4px); }
&:last-child { @include border-right-radius(4px); }
> {
.button {
&:first-child {
@include border-left-radius(4px);
}
&:last-child {
@include border-right-radius(4px);
}
}
}
li {
list-style: none;
Expand All @@ -131,15 +137,32 @@
}
}

%button-only-child {
@include border-radius(4px);
margin-right: 4px;
}

ul {
&.button-group {
margin: $margin-medium;
li {
&:nth-child(1):nth-last-child(1) {
.button {
@extend %button-only-child;
}
}
}
}
}

p {
&.button-group {
margin-top: 0;
.button {
&:nth-child(1):nth-last-child(1) {
@extend %button-only-child;
}
}
}
}

Expand All @@ -152,11 +175,6 @@
}
}

p.button-group .button:nth-child(1):nth-last-child(1), ul.button-group li:nth-child(1):nth-last-child(1) .button {
@include border-radius(4px);
margin-right: 4px;
}

.button-toolbar {
margin-bottom: $spacing-medium;
margin-top: $spacing-medium;
Expand Down Expand Up @@ -204,16 +222,34 @@
}
}

%button-only-child-rtl {
margin-right: auto;
margin-left: 4px;
}

ul {
&.button-group {
margin: 0 10px 10px;
li {
&:nth-child(1):nth-last-child(1) {
.button {
@extend %button-only-child-rtl;
}
}
}
}
}

p.button-group .button:nth-child(1):nth-last-child(1), ul.button-group li:nth-child(1):nth-last-child(1) .button{
margin-right: auto;
margin-left: 4px;
p {
&.button-group {
.button {
&:nth-child(1):nth-last-child(1) {
@extend %button-only-child-rtl;
}
}
}
}

[class*="span-"] {
ul {
&.button-group, &.menu-horizontal {
Expand Down

0 comments on commit 9bfa57c

Please sign in to comment.