diff options
| author | Mark Otto <[email protected]> | 2013-08-17 18:59:50 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-08-17 18:59:50 -0700 |
| commit | c56a749323836b7e0b7401d41de1d0c68a7cb7a8 (patch) | |
| tree | 6cf54bdb0f90208077fe04b4d7260d68f9c288a0 /less/theme.less | |
| parent | ba20e512ce53e7cc771ba06d492a01d48db6cc97 (diff) | |
| download | bootstrap-c56a749323836b7e0b7401d41de1d0c68a7cb7a8.tar.xz bootstrap-c56a749323836b7e0b7401d41de1d0c68a7cb7a8.zip | |
Finish first pass at and docment Bootstrap v2-ish theme
* Adds new "theme" example
* Adds new theme.less file to provide all the overrides and additional
styles for the theme
* theme.less compiles, via Grunt, to two new files to `dist/css`,
bootstrap-theme.css and bootstrap-theme.min.css
Diffstat (limited to 'less/theme.less')
| -rw-r--r-- | less/theme.less | 181 |
1 files changed, 175 insertions, 6 deletions
diff --git a/less/theme.less b/less/theme.less index 0ad042204..4acf9ee76 100644 --- a/less/theme.less +++ b/less/theme.less @@ -1,22 +1,44 @@ // +// Load core variables and mixins +// -------------------------------------------------- + +@import "variables.less"; +@import "mixins.less"; + + + +// // Buttons // -------------------------------------------------- -// Button mixin for generating new styles -.btn-styles(@btn-color: #555) { +// Common styles +.btn-default, +.btn-primary, +.btn-success, +.btn-info, +.btn-warning, +.btn-danger { text-shadow: 0 -1px 0 rgba(0,0,0,.2); - #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 10%)); - border-color: darken(@btn-color, 12%); @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075); .box-shadow(@shadow); // Reset the shadow &:active, &.active { + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); + } +} + +// Button mixin for generating new styles +.btn-styles(@btn-color: #555;) { + #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 10%)); + border-color: darken(@btn-color, 12%); + + &:active, + &.active { background-color: darken(@btn-color, 10%); border-color: darken(@btn-color, 12%); - .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); } } @@ -30,7 +52,7 @@ } // Apply the mixin to the buttons -.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; } +.btn-default { .btn-styles(@btn-default-bg;); text-shadow: 0 1px 0 #fff; border-color: #ccc; } .btn-primary { .btn-styles(@btn-primary-bg); } .btn-success { .btn-styles(@btn-success-bg); } .btn-warning { .btn-styles(@btn-warning-bg); } @@ -39,6 +61,31 @@ +// +// Images +// -------------------------------------------------- + +.thumbnail, +.img-thumbnail { + .box-shadow(0 1px 2px rgba(0,0,0,.075)); +} + + + +// +// Dropdowns +// -------------------------------------------------- + +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus, +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%)); + background-color: darken(@dropdown-link-hover-bg, 5%); +} + + // // Navbar @@ -47,11 +94,18 @@ // Basic navbar .navbar { #gradient > .vertical(@start-color: lighten(@navbar-bg, 10%); @end-color: @navbar-bg;); + border-radius: @border-radius-base; + @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075); + .box-shadow(@shadow); .navbar-nav > .active > a { background-color: @navbar-bg; } } +.navbar-brand, +.navbar-nav > li > a { + text-shadow: 0 1px 0 rgba(255,255,255,.25); +} // Inverted navbar .navbar-inverse { @@ -60,4 +114,119 @@ .navbar-nav > .active > a { background-color: @navbar-inverse-bg; } + + .navbar-brand, + .navbar-nav > li > a { + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } +} + +// Undo rounded corners in static and fixed navbars +.navbar-static-top, +.navbar-fixed-top, +.navbar-fixed-bottom { + border-radius: 0; +} + + + +// +// Alerts +// -------------------------------------------------- + +// Common styles +.alert { + text-shadow: 0 1px 0 rgba(255,255,255,.2); + @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05); + .box-shadow(@shadow); +} + +// Alert mixin for generating new styles +.alert-styles(@color) { + #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%)); + border-color: darken(@color, 15%); +} + +// Apply the mixin to the alerts +.alert { .alert-styles(@alert-bg); } +.alert-success { .alert-styles(@alert-success-bg); } +.alert-info { .alert-styles(@alert-info-bg); } +.alert-danger { .alert-styles(@alert-danger-bg); } + + + +// +// Progress bars +// -------------------------------------------------- + +// Give the progress background some depth +.progress { + #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg;) +} + +// Progress bar mixin for generating new styles +.progress-bar-styles(@color) { + #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%)); +} + +// Apply the mixin to the progress bars +.progress-bar { .progress-bar-styles(@progress-bar-bg); } +.progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); } +.progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); } +.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); } +.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); } + + + +// +// List groups +// -------------------------------------------------- + +.list-group { + border-radius: @border-radius-base; + .box-shadow(0 1px 2px rgba(0,0,0,.075)); +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%); + #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%)); + border-color: darken(@list-group-active-border, 7.5%); +} + + + +// +// Panels +// -------------------------------------------------- + +// Common styles +.panel { + .box-shadow(0 1px 2px rgba(0,0,0,.05)); +} + +// Alert mixin for generating new styles +.panel-heading-styles(@color) { + #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%)); +} + +// Apply the mixin to the panel headings only +.panel-heading { .panel-heading-styles(@panel-heading-bg); } +.panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); } +.panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); } +.panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); } +.panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); } +.panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); } + + + +// +// Wells +// -------------------------------------------------- + +.well { + #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg;); + border-color: darken(@well-bg, 10%); + @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1); + .box-shadow(@shadow); } |
