Commit c38b7206 authored by Mark Otto's avatar Mark Otto

overhaul buttons

parent a932476f
This diff is collapsed.
...@@ -1729,8 +1729,8 @@ For example, <code><section></code> should be wrapped as inlin ...@@ -1729,8 +1729,8 @@ For example, <code><section></code> should be wrapped as inlin
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><button type="button" class="btn">Default</button></td> <td><button type="button" class="btn btn-default">Default</button></td>
<td><code>btn</code></td> <td><code>btn btn-default</code></td>
<td>Standard gray button with gradient</td> <td>Standard gray button with gradient</td>
</tr> </tr>
<tr> <tr>
...@@ -1738,11 +1738,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin ...@@ -1738,11 +1738,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin
<td><code>btn btn-primary</code></td> <td><code>btn btn-primary</code></td>
<td>Provides extra visual weight and identifies the primary action in a set of buttons</td> <td>Provides extra visual weight and identifies the primary action in a set of buttons</td>
</tr> </tr>
<tr>
<td><button type="button" class="btn btn-info">Info</button></td>
<td><code>btn btn-info</code></td>
<td>Used as an alternative to the default styles</td>
</tr>
<tr> <tr>
<td><button type="button" class="btn btn-success">Success</button></td> <td><button type="button" class="btn btn-success">Success</button></td>
<td><code>btn btn-success</code></td> <td><code>btn btn-success</code></td>
...@@ -1758,11 +1753,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin ...@@ -1758,11 +1753,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin
<td><code>btn btn-danger</code></td> <td><code>btn btn-danger</code></td>
<td>Indicates a dangerous or potentially negative action</td> <td>Indicates a dangerous or potentially negative action</td>
</tr> </tr>
<tr>
<td><button type="button" class="btn btn-inverse">Inverse</button></td>
<td><code>btn btn-inverse</code></td>
<td>Alternate dark gray button, not tied to a semantic action or use</td>
</tr>
<tr> <tr>
<td><button type="button" class="btn btn-link">Link</button></td> <td><button type="button" class="btn btn-link">Link</button></td>
<td><code>btn btn-link</code></td> <td><code>btn btn-link</code></td>
......
...@@ -1669,8 +1669,8 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin ...@@ -1669,8 +1669,8 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><button type="button" class="btn">Default</button></td> <td><button type="button" class="btn btn-default">Default</button></td>
<td><code>btn</code></td> <td><code>btn btn-default</code></td>
<td>Standard gray button with gradient</td> <td>Standard gray button with gradient</td>
</tr> </tr>
<tr> <tr>
...@@ -1678,11 +1678,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin ...@@ -1678,11 +1678,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin
<td><code>btn btn-primary</code></td> <td><code>btn btn-primary</code></td>
<td>Provides extra visual weight and identifies the primary action in a set of buttons</td> <td>Provides extra visual weight and identifies the primary action in a set of buttons</td>
</tr> </tr>
<tr>
<td><button type="button" class="btn btn-info">Info</button></td>
<td><code>btn btn-info</code></td>
<td>Used as an alternative to the default styles</td>
</tr>
<tr> <tr>
<td><button type="button" class="btn btn-success">Success</button></td> <td><button type="button" class="btn btn-success">Success</button></td>
<td><code>btn btn-success</code></td> <td><code>btn btn-success</code></td>
...@@ -1698,11 +1693,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin ...@@ -1698,11 +1693,6 @@ For example, &lt;code&gt;&lt;section&gt;&lt;/code&gt; should be wrapped as inlin
<td><code>btn btn-danger</code></td> <td><code>btn btn-danger</code></td>
<td>Indicates a dangerous or potentially negative action</td> <td>Indicates a dangerous or potentially negative action</td>
</tr> </tr>
<tr>
<td><button type="button" class="btn btn-inverse">Inverse</button></td>
<td><code>btn btn-inverse</code></td>
<td>Alternate dark gray button, not tied to a semantic action or use</td>
</tr>
<tr> <tr>
<td><button type="button" class="btn btn-link">Link</button></td> <td><button type="button" class="btn btn-link">Link</button></td>
<td><code>btn btn-link</code></td> <td><code>btn btn-link</code></td>
......
...@@ -137,12 +137,6 @@ ...@@ -137,12 +137,6 @@
.btn-success.dropdown-toggle { .btn-success.dropdown-toggle {
background-color: @btn-backround-success-highlight; background-color: @btn-backround-success-highlight;
} }
.btn-info.dropdown-toggle {
background-color: @btn-backround-info-highlight;
}
.btn-inverse.dropdown-toggle {
background-color: @btn-backround-inverse-highlight;
}
} }
......
...@@ -6,6 +6,59 @@ ...@@ -6,6 +6,59 @@
// Base styles // Base styles
// -------------------------------------------------- // --------------------------------------------------
// Core styles
.btn {
display: inline-block;
padding: 7px 13px;
margin-bottom: 0; // For input.btn
font-size: @font-size-base;
font-weight: bold;
line-height: @line-height-base;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 0;
border-radius: @border-radius-base;
//.transition(all .075s ease-in-out);
&:focus {
.tab-focus();
}
&:hover {
text-decoration: none;
}
&:active,
&.active {
outline: 0;
.box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
}
&.disabled,
&[disabled] {
cursor: default;
.opacity(65);
.box-shadow(none);
}
}
// Default button visuals
.btn-default {
padding: 6px 12px;
color: #5a5a5a;
background-color: #fff;
border: 1px solid #ccc;
&:hover {
color: #fff;
background-color: #999;
border-color: #999;
}
}
/*
// Core // Core
.btn { .btn {
display: inline-block; display: inline-block;
...@@ -57,7 +110,7 @@ ...@@ -57,7 +110,7 @@
} }
} }
*/
// Button Sizes // Button Sizes
// ------------------------- // -------------------------
...@@ -126,47 +179,21 @@ input[type="button"] { ...@@ -126,47 +179,21 @@ input[type="button"] {
// Alternate buttons // Alternate buttons
// -------------------------------------------------- // --------------------------------------------------
// Provide *some* extra contrast for those who can get it
.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
color: rgba(255,255,255,.75);
}
// Set the backgrounds
// -------------------------
.btn {
// reset here as of 2.0.3 due to Recess property order
border-color: #c5c5c5;
border-color: rgba(0,0,0,.15) rgba(0,0,0,.15) rgba(0,0,0,.25);
}
.btn-primary { .btn-primary {
.buttonBackground(@btn-backround-primary, @btn-backround-primary-highlight); .buttonBackground(@btn-backround-primary);
} }
// Warning appears are orange // Warning appears are orange
.btn-warning { .btn-warning {
.buttonBackground(@btn-backround-warning, @btn-backround-warning-highlight); .buttonBackground(@btn-backround-warning);
} }
// Danger and error appear as red // Danger and error appear as red
.btn-danger { .btn-danger {
.buttonBackground(@btn-backround-danger, @btn-backround-danger-highlight); .buttonBackground(@btn-backround-danger);
} }
// Success appears as green // Success appears as green
.btn-success { .btn-success {
.buttonBackground(@btn-backround-success, @btn-backround-success-highlight); .buttonBackground(@btn-backround-success);
}
// Info appears as a neutral blue
.btn-info {
.buttonBackground(@btn-backround-info, @btn-backround-info-highlight);
} }
// Inverse appears as dark gray
.btn-inverse {
.buttonBackground(@btn-backround-inverse, @btn-backround-inverse-highlight);
}
// Link buttons // Link buttons
......
...@@ -405,25 +405,17 @@ ...@@ -405,25 +405,17 @@
// Button backgrounds // Button backgrounds
// ------------------ // ------------------
.buttonBackground(@startColor, @endColor, @text-color: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { .buttonBackground(@background-color: #333, @text-color: #fff) {
color: @text-color; color: @text-color;
text-shadow: @textShadow; background-color: @background-color;
#gradient > .vertical(@startColor, @endColor);
border-color: @endColor @endColor darken(@endColor, 15%);
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
.reset-filter();
// in these cases the gradient won't cover the background, so we override
&:hover, &:active, &.active, &.disabled, &[disabled] {
color: @text-color;
background-color: @endColor;
}
// IE8 can't handle box-shadow to show active, so we darken a bit ourselves &:hover,
&:active, &:active,
&.active { &.active {
background-color: darken(@endColor, 10%) e("\9"); color: @text-color;
background-color: darken(@background-color, 10%);
} }
} }
......
...@@ -82,9 +82,6 @@ ...@@ -82,9 +82,6 @@
@btn-backround-primary: @link-color; @btn-backround-primary: @link-color;
@btn-backround-primary-highlight: spin(@btn-backround-primary, 20%); @btn-backround-primary-highlight: spin(@btn-backround-primary, 20%);
@btn-backround-info: #5bc0de;
@btn-backround-info-highlight: #2f96b4;
@btn-backround-success: #62c462; @btn-backround-success: #62c462;
@btn-backround-success-highlight: #51a351; @btn-backround-success-highlight: #51a351;
...@@ -94,9 +91,6 @@ ...@@ -94,9 +91,6 @@
@btn-backround-danger: #ee5f5b; @btn-backround-danger: #ee5f5b;
@btn-backround-danger-highlight: #bd362f; @btn-backround-danger-highlight: #bd362f;
@btn-backround-inverse: #444;
@btn-backround-inverse-highlight: @grayDarker;
// Forms // Forms
// ------------------------- // -------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment