mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
refactor buttons.less
This commit is contained in:
parent
155047c3e6
commit
21bebe77fe
Binary file not shown.
172
docs/assets/css/bootstrap.css
vendored
172
docs/assets/css/bootstrap.css
vendored
@ -1653,6 +1653,92 @@ table .span12 {
|
||||
filter: alpha(opacity=40);
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 4px 10px 4px;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #fafafa;
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
|
||||
background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-repeat: no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: #bbb;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
cursor: pointer;
|
||||
*margin-left: .3em;
|
||||
}
|
||||
.btn:first-child {
|
||||
*margin-left: 0;
|
||||
}
|
||||
.btn:hover {
|
||||
color: #333333;
|
||||
text-decoration: none;
|
||||
background-color: #e6e6e6;
|
||||
background-position: 0 -15px;
|
||||
-webkit-transition: background-position 0.1s linear;
|
||||
-moz-transition: background-position 0.1s linear;
|
||||
-ms-transition: background-position 0.1s linear;
|
||||
-o-transition: background-position 0.1s linear;
|
||||
transition: background-position 0.1s linear;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: thin dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.btn.active, .btn:active {
|
||||
background-image: none;
|
||||
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
background-color: #e6e6e6;
|
||||
background-color: #d9d9d9 \9;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
outline: 0;
|
||||
}
|
||||
.btn.disabled, .btn[disabled] {
|
||||
cursor: default;
|
||||
background-image: none;
|
||||
background-color: #e6e6e6;
|
||||
opacity: 0.65;
|
||||
filter: alpha(opacity=65);
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.btn.large {
|
||||
padding: 9px 14px;
|
||||
font-size: 15px;
|
||||
line-height: normal;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btn.large .icon {
|
||||
margin-top: 1px;
|
||||
}
|
||||
.btn.small {
|
||||
padding: 5px 9px;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.btn.small .icon {
|
||||
margin-top: -1px;
|
||||
}
|
||||
.btn.primary,
|
||||
.btn.primary:hover,
|
||||
.btn.warning,
|
||||
@ -1793,92 +1879,6 @@ table .span12 {
|
||||
.btn.info:active, .btn.info.active {
|
||||
background-color: #24748c \9;
|
||||
}
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 4px 10px 4px;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #fafafa;
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
|
||||
background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
|
||||
background-repeat: no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: #bbb;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
cursor: pointer;
|
||||
*margin-left: .3em;
|
||||
}
|
||||
.btn:first-child {
|
||||
*margin-left: 0;
|
||||
}
|
||||
.btn:hover {
|
||||
color: #333333;
|
||||
text-decoration: none;
|
||||
background-color: #e6e6e6;
|
||||
background-position: 0 -15px;
|
||||
-webkit-transition: background-position 0.1s linear;
|
||||
-moz-transition: background-position 0.1s linear;
|
||||
-ms-transition: background-position 0.1s linear;
|
||||
-o-transition: background-position 0.1s linear;
|
||||
transition: background-position 0.1s linear;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: thin dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.btn.active, .btn:active {
|
||||
background-image: none;
|
||||
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
background-color: #e6e6e6;
|
||||
background-color: #d9d9d9 \9;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
outline: 0;
|
||||
}
|
||||
.btn.disabled, .btn[disabled] {
|
||||
cursor: default;
|
||||
background-image: none;
|
||||
background-color: #e6e6e6;
|
||||
opacity: 0.65;
|
||||
filter: alpha(opacity=65);
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.btn.large {
|
||||
padding: 9px 14px;
|
||||
font-size: 15px;
|
||||
line-height: normal;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btn.large .icon {
|
||||
margin-top: 1px;
|
||||
}
|
||||
.btn.small {
|
||||
padding: 5px 9px;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.btn.small .icon {
|
||||
margin-top: -1px;
|
||||
}
|
||||
button.btn, input[type="submit"].btn {
|
||||
*padding-top: 2px;
|
||||
*padding-bottom: 2px;
|
||||
|
@ -73,7 +73,7 @@ hr.soften {
|
||||
line-height: 36px;
|
||||
color: #333;
|
||||
}
|
||||
.jumbotron .btn-large {
|
||||
.jumbotron .btn {
|
||||
font-size: 20px;
|
||||
font-weight: normal;
|
||||
padding: 14px 24px;
|
||||
|
@ -74,8 +74,6 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div id="overview">
|
||||
|
||||
<!-- Masthead
|
||||
================================================== -->
|
||||
<header class="jumbotron masthead">
|
||||
@ -83,8 +81,8 @@
|
||||
<h1>Bootstrap, from Twitter</h1>
|
||||
<p>Simple and flexible HTML, CSS, and Javascript for popular user interface components and interactions.</p>
|
||||
<p class="download-info">
|
||||
<a href="https://github.com/twitter/bootstrap/" class="btn primary btn-large">View project on GitHub</a>
|
||||
<a href="assets/bootstrap.zip" class="btn btn-large">Download Bootstrap</a>
|
||||
<a href="https://github.com/twitter/bootstrap/" class="btn primary large">View project on GitHub</a>
|
||||
<a href="assets/bootstrap.zip" class="btn large">Download Bootstrap</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -212,7 +210,6 @@
|
||||
</ul>
|
||||
|
||||
</div><!-- /.marketing -->
|
||||
</div><!-- /#overview -->
|
||||
|
||||
<!-- Footer
|
||||
================================================== -->
|
||||
|
7
docs/templates/pages/index.mustache
vendored
7
docs/templates/pages/index.mustache
vendored
@ -1,5 +1,3 @@
|
||||
<div id="overview">
|
||||
|
||||
<!-- Masthead
|
||||
================================================== -->
|
||||
<header class="jumbotron masthead">
|
||||
@ -7,8 +5,8 @@
|
||||
<h1>{{_i}}Bootstrap, from Twitter{{/i}}</h1>
|
||||
<p>Simple and flexible HTML, CSS, and Javascript for popular user interface components and interactions.</p>
|
||||
<p class="download-info">
|
||||
<a href="https://github.com/twitter/bootstrap/" class="btn primary btn-large">{{_i}}View project on GitHub{{/i}}</a>
|
||||
<a href="assets/bootstrap.zip" class="btn btn-large">{{_i}}Download Bootstrap{{/i}}</a>
|
||||
<a href="https://github.com/twitter/bootstrap/" class="btn primary large">{{_i}}View project on GitHub{{/i}}</a>
|
||||
<a href="assets/bootstrap.zip" class="btn large">{{_i}}Download Bootstrap{{/i}}</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -136,4 +134,3 @@
|
||||
</ul>
|
||||
|
||||
</div><!-- /.marketing -->
|
||||
</div><!-- /#overview -->
|
@ -2,57 +2,11 @@
|
||||
// -------------
|
||||
|
||||
|
||||
// Colors
|
||||
// ------
|
||||
|
||||
.btn {
|
||||
// Set text color
|
||||
&.primary,
|
||||
&.primary:hover,
|
||||
&.warning,
|
||||
&.warning:hover,
|
||||
&.danger,
|
||||
&.danger:hover,
|
||||
&.success,
|
||||
&.success:hover,
|
||||
&.info,
|
||||
&.info:hover {
|
||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
||||
color: @white
|
||||
}
|
||||
&.primary.active,
|
||||
&.warning.active,
|
||||
&.danger.active,
|
||||
&.success.active,
|
||||
&.info.active {
|
||||
color: rgba(255,255,255,.75);
|
||||
}
|
||||
&.primary {
|
||||
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
|
||||
}
|
||||
// Warning appears are orange
|
||||
&.warning {
|
||||
.buttonBackground(lighten(@orange, 15%), @orange);
|
||||
}
|
||||
// Danger and error appear as red
|
||||
&.danger {
|
||||
.buttonBackground(#ee5f5b, #bd362f);
|
||||
}
|
||||
// Success appears as green
|
||||
&.success {
|
||||
.buttonBackground(#62c462, #51a351);
|
||||
}
|
||||
// Info appears as a neutral blue
|
||||
&.info {
|
||||
.buttonBackground(#5bc0de, #2f96b4);
|
||||
}
|
||||
}
|
||||
|
||||
// Base styles
|
||||
// -----------
|
||||
// --------------------------------------------------
|
||||
|
||||
// Core
|
||||
.btn {
|
||||
// Button Base
|
||||
display: inline-block;
|
||||
padding: 4px 10px 4px;
|
||||
font-size: @baseFontSize;
|
||||
@ -68,9 +22,12 @@
|
||||
.box-shadow(@shadow);
|
||||
cursor: pointer;
|
||||
|
||||
// Give IE7 some love
|
||||
.ie7-restore-left-whitespace();
|
||||
}
|
||||
|
||||
&:hover {
|
||||
// Hover state
|
||||
.btn:hover {
|
||||
color: @grayDark;
|
||||
text-decoration: none;
|
||||
background-color: darken(@white, 10%);
|
||||
@ -82,13 +39,13 @@
|
||||
}
|
||||
|
||||
// Focus state for keyboard and accessibility
|
||||
&:focus {
|
||||
.btn:focus {
|
||||
.tab-focus();
|
||||
}
|
||||
|
||||
// Active and Disabled states
|
||||
&.active,
|
||||
&:active {
|
||||
// Active state
|
||||
.btn.active,
|
||||
.btn:active {
|
||||
background-image: none;
|
||||
@shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
|
||||
.box-shadow(@shadow);
|
||||
@ -97,8 +54,10 @@
|
||||
color: rgba(0,0,0,.5);
|
||||
outline: 0;
|
||||
}
|
||||
&.disabled,
|
||||
&[disabled] {
|
||||
|
||||
// Disabled state
|
||||
.btn.disabled,
|
||||
.btn[disabled] {
|
||||
cursor: default;
|
||||
background-image: none;
|
||||
background-color: darken(@white, 10%);
|
||||
@ -106,27 +65,85 @@
|
||||
.box-shadow(none);
|
||||
}
|
||||
|
||||
|
||||
// Button Sizes
|
||||
&.large {
|
||||
// --------------------------------------------------
|
||||
|
||||
// Large
|
||||
.btn.large {
|
||||
padding: 9px 14px;
|
||||
font-size: @baseFontSize + 2px;
|
||||
line-height: normal;
|
||||
.border-radius(5px);
|
||||
}
|
||||
&.large .icon {
|
||||
.btn.large .icon {
|
||||
margin-top: 1px;
|
||||
}
|
||||
&.small {
|
||||
|
||||
// Small
|
||||
.btn.small {
|
||||
padding: 5px 9px;
|
||||
font-size: @baseFontSize - 2px;
|
||||
line-height: @baseLineHeight - 2px;
|
||||
}
|
||||
&.small .icon {
|
||||
.btn.small .icon {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
|
||||
// Alternate buttons
|
||||
// --------------------------------------------------
|
||||
|
||||
// Set text color
|
||||
// -------------------------
|
||||
.btn.primary,
|
||||
.btn.primary:hover,
|
||||
.btn.warning,
|
||||
.btn.warning:hover,
|
||||
.btn.danger,
|
||||
.btn.danger:hover,
|
||||
.btn.success,
|
||||
.btn.success:hover,
|
||||
.btn.info,
|
||||
.btn.info:hover {
|
||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
||||
color: @white
|
||||
}
|
||||
// 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 {
|
||||
color: rgba(255,255,255,.75);
|
||||
}
|
||||
|
||||
// Help Firefox not be a jerk about adding extra padding to buttons
|
||||
// Set the backgrounds
|
||||
// -------------------------
|
||||
.btn.primary {
|
||||
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
|
||||
}
|
||||
// Warning appears are orange
|
||||
.btn.warning {
|
||||
.buttonBackground(lighten(@orange, 15%), @orange);
|
||||
}
|
||||
// Danger and error appear as red
|
||||
.btn.danger {
|
||||
.buttonBackground(#ee5f5b, #bd362f);
|
||||
}
|
||||
// Success appears as green
|
||||
.btn.success {
|
||||
.buttonBackground(#62c462, #51a351);
|
||||
}
|
||||
// Info appears as a neutral blue
|
||||
.btn.info {
|
||||
.buttonBackground(#5bc0de, #2f96b4);
|
||||
}
|
||||
|
||||
|
||||
// Cross-browser Jank
|
||||
// --------------------------------------------------
|
||||
|
||||
button.btn,
|
||||
input[type="submit"].btn {
|
||||
&::-moz-focus-inner {
|
||||
|
Loading…
x
Reference in New Issue
Block a user