diff --git a/bootstrap.css b/bootstrap.css index 69c53f484d55..48441bbc8833 100644 --- a/bootstrap.css +++ b/bootstrap.css @@ -6,7 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Sun Sep 18 14:19:52 PDT 2011 + * Date: Sun 25 Sep 2011 16:29:58 PDT */ /* Reset.less * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). @@ -1888,6 +1888,56 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { padding: 0; border: 0; } +.toggle.active { + background-color: #bfbfbf; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#bfbfbf), to(#bfbfbf)); + background-image: -moz-linear-gradient(top, #bfbfbf, #bfbfbf); + background-image: -ms-linear-gradient(top, #bfbfbf, #bfbfbf); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #bfbfbf), color-stop(100%, #bfbfbf)); + background-image: -webkit-linear-gradient(top, #bfbfbf, #bfbfbf); + background-image: -o-linear-gradient(top, #bfbfbf, #bfbfbf); + background-image: linear-gradient(top, #bfbfbf, #bfbfbf); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfbfbf', endColorstr='#bfbfbf', GradientType=0); + color: #333; + text-decoration: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.radio .active { + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.btngroup { + display: inline-block; + vertical-align: bottom; +} +.btngroup .btn { + float: left; + border-radius: 0; +} +.btngroup .btn:nth-child(n+2) { + border-left: none; +} +.btngroup .btn:first-child { + border-radius: 4px 0 0 4px; +} +.btngroup .btn:last-child { + border-radius: 0px 4px 4px 0px; +} .close { float: right; color: #000000; diff --git a/bootstrap.min.css b/bootstrap.min.css index aabdf2428b30..b8220d47f941 100644 --- a/bootstrap.min.css +++ b/bootstrap.min.css @@ -272,6 +272,13 @@ footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;} .btn.small{padding:7px 9px 7px;font-size:11px;} :root .alert-message,:root .btn{border-radius:0 \0;} button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0;} +.toggle.active{background-color:#bfbfbf;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#bfbfbf), to(#bfbfbf));background-image:-moz-linear-gradient(top, #bfbfbf, #bfbfbf);background-image:-ms-linear-gradient(top, #bfbfbf, #bfbfbf);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #bfbfbf), color-stop(100%, #bfbfbf));background-image:-webkit-linear-gradient(top, #bfbfbf, #bfbfbf);background-image:-o-linear-gradient(top, #bfbfbf, #bfbfbf);background-image:linear-gradient(top, #bfbfbf, #bfbfbf);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfbfbf', endColorstr='#bfbfbf', GradientType=0);color:#333;text-decoration:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} +.radio .active{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} +.btngroup{display:inline-block;vertical-align:bottom;} +.btngroup .btn{float:left;border-radius:0;} +.btngroup .btn:nth-child(n+2){border-left:none;} +.btngroup .btn:first-child{border-radius:4px 0 0 4px;} +.btngroup .btn:last-child{border-radius:0px 4px 4px 0px;} .close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=20);-khtml-opacity:0.2;-moz-opacity:0.2;opacity:0.2;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;} .alert-message{position:relative;padding:7px 15px;margin-bottom:18px;color:#404040;background-color:#eedc94;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));background-image:-moz-linear-gradient(top, #fceec1, #eedc94);background-image:-ms-linear-gradient(top, #fceec1, #eedc94);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));background-image:-webkit-linear-gradient(top, #fceec1, #eedc94);background-image:-o-linear-gradient(top, #fceec1, #eedc94);background-image:linear-gradient(top, #fceec1, #eedc94);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#eedc94 #eedc94 #e4c652;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);border-width:1px;border-style:solid;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);}.alert-message .close{*margin-top:3px;} .alert-message h5{line-height:18px;} diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 5beba46e1fa4..ed5b16a75299 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -26,6 +26,10 @@ $(document).ready(function(){ e.preventDefault() }) + // radios and toggles + $('.radio .btn').radio() + $('.toggle.btn').toggleBtn(); + // Copy code blocks in docs $(".copy-code").focus(function () { var el = this; diff --git a/docs/index.html b/docs/index.html index 9fcc5c368f31..01961c6139e0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,6 +24,7 @@ + @@ -1291,6 +1292,50 @@
Three flavours: regular, radios and toggles. First, wrap your buttons in a .btngroup.
For radios, apply .radio to the wrapper. For toggles, apply .toggle to each button in the group.
In a radio group, only one button may be active at a time. Add the class .radio to the button group.
Toggles work like radios, but each button in the group can be set independently. Add .toggle to each button in the button group. Lone buttons can also be toggles.
Toggle buttons and radio buttons in button groups.
+ Download +
+$('.radio .btn').radio()
+
+$('.toggle.btn').toggleBtn()
+ For radio buttons:
++<div class="btngroup radio"> + <a class="btn">Left</a> + <a class="btn">Middle</a> + <a class="btn">Right</a> +</div>+
For toggle buttons:
++<div class="btngroup"> + <a class="btn toggle">Left</a> + <a class="btn toggle">Right</a> +</div>+
Toggles need not be in a button group:
++<a class="btn toggle">Toggle</a>+
Adds radio button functionality to selected buttons.
+Adds toggle button functionality to selected buttons.
+