diff options
author | Mark Otto <otto@github.com> | 2014-07-09 08:19:14 +0400 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2014-07-09 08:19:14 +0400 |
commit | f380ca21e207e688e40a8cbef6d0b5a2c2a00472 (patch) | |
tree | cf28901efb6ec84b0df698ed555d2281462a7017 /less | |
parent | ff4ff3bd0619035313ef245839fae7865039dd25 (diff) |
Use .box-shadow() mixin so we can enable/disable them
Diffstat (limited to 'less')
-rw-r--r-- | less/button-groups.less | 4 | ||||
-rw-r--r-- | less/buttons.less | 6 | ||||
-rw-r--r-- | less/code.less | 8 | ||||
-rw-r--r-- | less/dropdowns.less | 2 | ||||
-rw-r--r-- | less/forms.less | 2 | ||||
-rw-r--r-- | less/mixins.less | 4 | ||||
-rw-r--r-- | less/mixins/forms.less | 13 | ||||
-rw-r--r-- | less/modals.less | 4 | ||||
-rw-r--r-- | less/navbar.less | 10 | ||||
-rw-r--r-- | less/popovers.less | 5 | ||||
-rw-r--r-- | less/progress-bars.less | 6 | ||||
-rw-r--r-- | less/theme.less | 20 | ||||
-rw-r--r-- | less/variables.less | 1 |
13 files changed, 44 insertions, 41 deletions
diff --git a/less/button-groups.less b/less/button-groups.less index 36d165b20a..1e9a8c53d5 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -117,11 +117,11 @@ // The clickable button for toggling the menu // Remove the gradient and set the same inset shadow as the :active state .btn-group.open .dropdown-toggle { - box-shadow: inset 0 3px 5px rgba(0,0,0,.125); + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); // Show no shadow for `.btn-link` since it has no other button styles. &.btn-link { - box-shadow: none; + .box-shadow(none); } } diff --git a/less/buttons.less b/less/buttons.less index dc76db2ed3..609019fe62 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -39,7 +39,7 @@ &.active { outline: 0; background-image: none; - box-shadow: inset 0 3px 5px rgba(0,0,0,.125); + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); } &.disabled, @@ -48,7 +48,7 @@ cursor: not-allowed; pointer-events: none; // Future-proof disabling of clicks opacity: .65; - box-shadow: none; + .box-shadow(none); } } @@ -90,7 +90,7 @@ &[disabled], fieldset[disabled] & { background-color: transparent; - box-shadow: none; + .box-shadow(none); } &, &:hover, diff --git a/less/code.less b/less/code.less index d618d302ab..0f76b666bc 100644 --- a/less/code.less +++ b/less/code.less @@ -17,7 +17,7 @@ code { font-size: 90%; color: @code-color; background-color: @code-bg; - border-radius: @border-radius-base; + .border-radius(@border-radius-base); } // User input typically entered via keyboard @@ -26,13 +26,13 @@ kbd { font-size: 90%; color: @kbd-color; background-color: @kbd-bg; - border-radius: @border-radius-small; - box-shadow: inset 0 -.1rem 0 rgba(0,0,0,.25); + .border-radius(@border-radius-small); + .box-shadow(inset 0 -.1rem 0 rgba(0,0,0,.25)); kbd { padding: 0; font-size: 100%; - box-shadow: none; + .box-shadow(none); } } diff --git a/less/dropdowns.less b/less/dropdowns.less index a047735660..c6f7d56f82 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -44,7 +44,7 @@ background-color: @dropdown-bg; border: 1px solid @dropdown-border; .border-radius(@border-radius-base); - box-shadow: 0 6px 12px rgba(0,0,0,.175); + .box-shadow(0 6px 12px rgba(0,0,0,.175)); background-clip: padding-box; // Dividers (basically an hr) within the dropdown diff --git a/less/forms.less b/less/forms.less index f0aed90fe7..86669b44e0 100644 --- a/less/forms.less +++ b/less/forms.less @@ -123,7 +123,7 @@ output { background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 border: 1px solid @input-border; .border-radius(@input-border-radius); - box-shadow: inset 0 1px 1px rgba(0,0,0,.075); + .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; // Customize the `:focus` state to imitate native WebKit styles. diff --git a/less/mixins.less b/less/mixins.less index 627cae3181..10636eba49 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -5,8 +5,8 @@ border-radius: @radius; } -.box-shadow(@shadow: 0 .1rem .2rem rgba(0,0,0,.1)) when (@enable-shadows = true) { - box-shadow: @shadow; +.box-shadow(@shadow) when (@enable-shadows = true) { + box-shadow: @arguments; } diff --git a/less/mixins/forms.less b/less/mixins/forms.less index 12af7f7460..504ca08804 100644 --- a/less/mixins/forms.less +++ b/less/mixins/forms.less @@ -20,10 +20,11 @@ // Set the border and box shadow on specific inputs to match .form-control { border-color: @border-color; - box-shadow: inset 0 1px 1px rgba(0,0,0,.075); // Redeclare so transitions work + .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work &:focus { border-color: darken(@border-color, 10%); - box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); + @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); + .box-shadow(@shadow); } } // Set validation states also for addons @@ -51,12 +52,12 @@ // // Example usage: change the default blue border and shadow to white for better // contrast against a dark gray background. -.form-control-focus(@color: @input-border-focus) { - @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); +.form-control-focus() { &:focus { - border-color: @color; + border-color: @input-border-focus; outline: 0; - box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @color-rgba; + @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @input-box-shadow-focus; + .box-shadow(@shadow); } } diff --git a/less/modals.less b/less/modals.less index a8fd0dd2ba..09cef4b31f 100644 --- a/less/modals.less +++ b/less/modals.less @@ -53,7 +53,7 @@ background-color: @modal-content-bg; border: 1px solid @modal-content-border-color; .border-radius(@border-radius-large); - box-shadow: 0 3px 9px rgba(0,0,0,.5); + .box-shadow(0 3px 9px rgba(0,0,0,.5)); background-clip: padding-box; // Remove focus outline from opened modal outline: 0; @@ -137,7 +137,7 @@ margin: 30px auto; } .modal-content { - box-shadow: 0 5px 15px rgba(0,0,0,.5); + .box-shadow(0 5px 15px rgba(0,0,0,.5)); } // Modal sizes diff --git a/less/navbar.less b/less/navbar.less index abb4aa2911..65e780e68b 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -52,7 +52,7 @@ padding-right: @navbar-padding-horizontal; padding-left: @navbar-padding-horizontal; border-top: 1px solid transparent; - box-shadow: inset 0 1px 0 rgba(255,255,255,.1); + .box-shadow(inset 0 1px 0 rgba(255,255,255,.1)); &:extend(.clearfix all); -webkit-overflow-scrolling: touch; @@ -63,7 +63,7 @@ @media (min-width: @grid-float-breakpoint) { width: auto; border-top: 0; - box-shadow: none; + .box-shadow(none); &.collapse { display: block !important; @@ -248,7 +248,7 @@ margin-top: 0; background-color: transparent; border: 0; - box-shadow: none; + .box-shadow(none); > li > a, .dropdown-header { padding: 5px 15px 5px 25px; @@ -290,7 +290,7 @@ padding: 10px @navbar-padding-horizontal; border-top: 1px solid transparent; border-bottom: 1px solid transparent; - box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); + .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)"); // Mixin behavior for optimum display .form-inline(); @@ -312,7 +312,7 @@ margin-right: 0; padding-top: 0; padding-bottom: 0; - box-shadow: none; + .box-shadow(none); } } diff --git a/less/popovers.less b/less/popovers.less index b22ad96be3..06a1156bb1 100644 --- a/less/popovers.less +++ b/less/popovers.less @@ -14,10 +14,9 @@ text-align: left; // Reset given new insertion method background-color: @popover-bg; background-clip: padding-box; - border: 1px solid @popover-fallback-border-color; border: 1px solid @popover-border-color; - border-radius: @border-radius-large; - box-shadow: 0 5px 10px rgba(0,0,0,.2); + .border-radius(@border-radius-large); + .box-shadow(0 5px 10px rgba(0,0,0,.2)); // Overrides for proper insertion white-space: normal; diff --git a/less/progress-bars.less b/less/progress-bars.less index 415f7056b9..c8ff47b313 100644 --- a/less/progress-bars.less +++ b/less/progress-bars.less @@ -30,7 +30,7 @@ margin-bottom: @line-height-computed; background-color: @progress-bg; .border-radius(@border-radius-base); - box-shadow: inset 0 1px 2px rgba(0,0,0,.1); + .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); } // Bar of progress @@ -43,7 +43,7 @@ color: @progress-bar-color; text-align: center; background-color: @progress-bar-bg; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); + .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); transition: width .6s ease; } @@ -74,7 +74,7 @@ min-width: 30px; background-color: transparent; background-image: none; - box-shadow: none; + .box-shadow(none); } } diff --git a/less/theme.less b/less/theme.less index f9bc280a79..36ecda53a3 100644 --- a/less/theme.less +++ b/less/theme.less @@ -19,12 +19,13 @@ .btn-warning, .btn-danger { text-shadow: 0 -1px 0 rgba(0,0,0,.2); - box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075); + @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); + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); } } @@ -77,9 +78,8 @@ // Images // -------------------------------------------------- -.thumbnail, .img-thumbnail { - box-shadow: 0 1px 2px rgba(0,0,0,.075); + .box-shadow(0 1px 2px rgba(0,0,0,.075)); } @@ -111,11 +111,12 @@ #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg); .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered .border-radius(@navbar-border-radius); - box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075); + @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 { #gradient > .vertical(@start-color: darken(@navbar-default-bg, 5%); @end-color: darken(@navbar-default-bg, 2%)); - box-shadow: inset 0 3px 9px rgba(0,0,0,.075); + .box-shadow(inset 0 3px 9px rgba(0,0,0,.075)); } } .navbar-brand, @@ -130,7 +131,7 @@ .navbar-nav > .active > a { #gradient > .vertical(@start-color: @navbar-inverse-bg; @end-color: lighten(@navbar-inverse-bg, 2.5%)); - box-shadow: inset 0 3px 9px rgba(0,0,0,.25); + .box-shadow(inset 0 3px 9px rgba(0,0,0,.25)); } .navbar-brand, @@ -155,7 +156,8 @@ // Common styles .alert { text-shadow: 0 1px 0 rgba(255,255,255,.2); - box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05); + @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05); + .box-shadow(@shadow); } // Mixin for generating new styles @@ -206,7 +208,7 @@ .list-group { .border-radius(@border-radius-base); - box-shadow: 0 1px 2px rgba(0,0,0,.075); + .box-shadow(0 1px 2px rgba(0,0,0,.075)); } .list-group-item.active, .list-group-item.active:hover, diff --git a/less/variables.less b/less/variables.less index 9c02f623f3..c7a99e5cb2 100644 --- a/less/variables.less +++ b/less/variables.less @@ -187,6 +187,7 @@ @input-border-radius: @border-radius-base; //** Border color for inputs on focus @input-border-focus: #66afe9; +@input-box-shadow-focus: rgba(102,175,233,.6); //** Placeholder text color @input-color-placeholder: @gray-light; |