refactor(button): fixed UI issues with new classes

Removed my long TODO comments. References #689
This commit is contained in:
Brandy Carney
2015-12-07 14:30:26 -05:00
parent 3fa93ac815
commit ae19f65229
3 changed files with 58 additions and 33 deletions

View File

@ -62,12 +62,7 @@ a.button {
// -------------------------------------------------- // --------------------------------------------------
.button-full { .button-full {
margin-right: 0;
margin-left: 0;
width: 100%; width: 100%;
border-radius: 0;
border-right-width: 0;
border-left-width: 0;
} }
@ -79,27 +74,10 @@ a.button {
border-radius: $button-round-border-radius; border-radius: $button-round-border-radius;
} }
// Full Outline Button
// --------------------------------------------------
.button-full.button-outline {
// TODO border-left-width: 0;
// button should have classes: border-right-width: 0;
// button, button-primary, button-secondary, etc. }
// button holds all styling with default primary color(will this affect outline/clear?) and
// the other classes change the color
//
// button-clear should have classes:
// button-clear, button-clear-primary, button-clear-secondary, etc.
// button-clear holds all clear styling with default primary color and
// the other classes change the color
//
// button-outline should have classes:
// button-outline, button-outline-primary, button-outline-secondary, etc.
// button-outline holds all outline styling with default primary color and
// the other classes change the color
//
// button-block should stand alone
// button-full should stand alone
// button-round should stand alone
// button-disabled should stand alone(?)
// button-sizes should stand alone (button-small, button-large, etc)
// button-fab errrrr

View File

@ -20,6 +20,7 @@ $button-ios-large-padding: 1.0em !default;
$button-ios-small-font-size: 1.3rem !default; $button-ios-small-font-size: 1.3rem !default;
$button-ios-small-height: 2.1em !default; $button-ios-small-height: 2.1em !default;
$button-ios-small-padding: 0.9em !default; $button-ios-small-padding: 0.9em !default;
$button-ios-small-icon-font-size: 1.3em !default;
// iOS Default Button // iOS Default Button
@ -84,6 +85,9 @@ $button-ios-small-padding: 0.9em !default;
font-size: $button-ios-small-font-size; font-size: $button-ios-small-font-size;
} }
.button-small.button-icon-only icon {
font-size: $button-ios-small-icon-font-size;
}
// iOS Block Button // iOS Block Button
// -------------------------------------------------- // --------------------------------------------------
@ -91,6 +95,19 @@ $button-ios-small-padding: 0.9em !default;
.button-block { .button-block {
// This fixes an issue with flexbox and button on iOS Safari. See #225 // This fixes an issue with flexbox and button on iOS Safari. See #225
display: block; display: block;
line-height: 2.8em;
}
// iOS Full Button
// --------------------------------------------------
.button-full {
margin-right: 0;
margin-left: 0;
border-radius: 0;
border-left: none;
border-right: none;
} }
@ -138,6 +155,11 @@ $button-ios-small-padding: 0.9em !default;
color: color-shade($button-ios-color); color: color-shade($button-ios-color);
background-color: transparent; background-color: transparent;
&.activated {
opacity: 0.4;
background-color: transparent;
}
&:hover:not(.disable-hover) { &:hover:not(.disable-hover) {
opacity: 0.6; opacity: 0.6;
color: color-shade($button-ios-color); color: color-shade($button-ios-color);
@ -167,6 +189,14 @@ $button-ios-small-padding: 0.9em !default;
} }
} }
// iOS Round Button
// --------------------------------------------------
.button-round {
padding: $button-round-padding;
border-radius: $button-round-border-radius;
}
// Generate iOS Button Colors // Generate iOS Button Colors
// -------------------------------------------------- // --------------------------------------------------

View File

@ -32,6 +32,7 @@ $button-md-large-padding: 1.0em !default;
$button-md-small-font-size: 1.3rem !default; $button-md-small-font-size: 1.3rem !default;
$button-md-small-height: 2.1em !default; $button-md-small-height: 2.1em !default;
$button-md-small-padding: 0.9em !default; $button-md-small-padding: 0.9em !default;
$button-md-small-icon-font-size: 1.4em !default;
// Material Design Default Button // Material Design Default Button
@ -66,6 +67,7 @@ $button-md-small-padding: 0.9em !default;
&.activated { &.activated {
box-shadow: $button-md-box-shadow-active; box-shadow: $button-md-box-shadow-active;
background-color: $button-md-color-activated;
} }
} }
@ -84,6 +86,7 @@ $button-md-small-padding: 0.9em !default;
&.activated { &.activated {
opacity: 1; opacity: 1;
background-color: $bg-color-activated;
} }
} }
@ -105,12 +108,20 @@ $button-md-small-padding: 0.9em !default;
font-size: $button-md-small-font-size; font-size: $button-md-small-font-size;
} }
.button-small.button-icon-only icon {
font-size: $button-md-small-icon-font-size;
}
// Material Design Full Button // Material Design Full Button
// -------------------------------------------------- // --------------------------------------------------
.button-full { .button-full {
border-radius: 0; border-radius: 0;
margin-right: 0;
margin-left: 0;
border-right-width: 0;
border-left-width: 0;
} }
@ -127,6 +138,7 @@ $button-md-small-padding: 0.9em !default;
opacity: 1; opacity: 1;
color: $background-md-color; color: $background-md-color;
background-color: $button-md-color; background-color: $button-md-color;
box-shadow: none;
} }
md-ripple { md-ripple {
@ -166,8 +178,12 @@ $button-md-small-padding: 0.9em !default;
color: color-shade($button-md-color); color: color-shade($button-md-color);
&.activated { &.activated {
opacity: 0.4;
background-color: $button-md-clear-active-background-color; background-color: $button-md-clear-active-background-color;
box-shadow: none;
}
&:hover:not(.disable-hover) {
color: color-shade($button-md-color);
} }
} }
@ -183,9 +199,10 @@ $button-md-small-padding: 0.9em !default;
background-color: transparent; background-color: transparent;
color: $fg-color; color: $fg-color;
&.activated { &.activated {
opacity: 0.4; background-color: $button-md-clear-active-background-color;
background-color: transparent; box-shadow: none;
} }
&:hover:not(.disable-hover) { &:hover:not(.disable-hover) {