theme.less 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. //
  2. // Load core variables and mixins
  3. // --------------------------------------------------
  4. @import "variables.less";
  5. @import "mixins.less";
  6. //
  7. // Buttons
  8. // --------------------------------------------------
  9. // Common styles
  10. .btn-default,
  11. .btn-primary,
  12. .btn-success,
  13. .btn-info,
  14. .btn-warning,
  15. .btn-danger {
  16. text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  17. @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);
  18. .box-shadow(@shadow);
  19. // Reset the shadow
  20. &:active,
  21. &.active {
  22. .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
  23. }
  24. .badge {
  25. text-shadow: none;
  26. }
  27. }
  28. // Mixin for generating new styles
  29. .btn-styles(@btn-color: #555) {
  30. #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));
  31. .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620
  32. background-repeat: repeat-x;
  33. border-color: darken(@btn-color, 14%);
  34. &:hover,
  35. &:focus {
  36. background-color: darken(@btn-color, 12%);
  37. background-position: 0 -15px;
  38. }
  39. &:active,
  40. &.active {
  41. background-color: darken(@btn-color, 12%);
  42. border-color: darken(@btn-color, 14%);
  43. }
  44. &.disabled,
  45. &:disabled,
  46. &[disabled] {
  47. background-color: darken(@btn-color, 12%);
  48. background-image: none;
  49. }
  50. }
  51. // Common styles
  52. .btn {
  53. // Remove the gradient for the pressed/active state
  54. &:active,
  55. &.active {
  56. background-image: none;
  57. }
  58. }
  59. // Apply the mixin to the buttons
  60. .btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }
  61. .btn-primary { .btn-styles(@btn-primary-bg); }
  62. .btn-success { .btn-styles(@btn-success-bg); }
  63. .btn-info { .btn-styles(@btn-info-bg); }
  64. .btn-warning { .btn-styles(@btn-warning-bg); }
  65. .btn-danger { .btn-styles(@btn-danger-bg); }
  66. //
  67. // Images
  68. // --------------------------------------------------
  69. .thumbnail,
  70. .img-thumbnail {
  71. .box-shadow(0 1px 2px rgba(0,0,0,.075));
  72. }
  73. //
  74. // Dropdowns
  75. // --------------------------------------------------
  76. .dropdown-menu > li > a:hover,
  77. .dropdown-menu > li > a:focus {
  78. #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));
  79. background-color: darken(@dropdown-link-hover-bg, 5%);
  80. }
  81. .dropdown-menu > .active > a,
  82. .dropdown-menu > .active > a:hover,
  83. .dropdown-menu > .active > a:focus {
  84. #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));
  85. background-color: darken(@dropdown-link-active-bg, 5%);
  86. }
  87. //
  88. // Navbar
  89. // --------------------------------------------------
  90. // Default navbar
  91. .navbar-default {
  92. #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);
  93. .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered
  94. border-radius: @navbar-border-radius;
  95. @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);
  96. .box-shadow(@shadow);
  97. .navbar-nav > .open > a,
  98. .navbar-nav > .active > a {
  99. #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));
  100. .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));
  101. }
  102. }
  103. .navbar-brand,
  104. .navbar-nav > li > a {
  105. text-shadow: 0 1px 0 rgba(255,255,255,.25);
  106. }
  107. // Inverted navbar
  108. .navbar-inverse {
  109. #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);
  110. .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257
  111. .navbar-nav > .open > a,
  112. .navbar-nav > .active > a {
  113. #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));
  114. .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));
  115. }
  116. .navbar-brand,
  117. .navbar-nav > li > a {
  118. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  119. }
  120. }
  121. // Undo rounded corners in static and fixed navbars
  122. .navbar-static-top,
  123. .navbar-fixed-top,
  124. .navbar-fixed-bottom {
  125. border-radius: 0;
  126. }
  127. // Fix active state of dropdown items in collapsed mode
  128. @media (max-width: @grid-float-breakpoint-max) {
  129. .navbar .navbar-nav .open .dropdown-menu > .active > a {
  130. &,
  131. &:hover,
  132. &:focus {
  133. color: #fff;
  134. #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));
  135. }
  136. }
  137. }
  138. //
  139. // Alerts
  140. // --------------------------------------------------
  141. // Common styles
  142. .alert {
  143. text-shadow: 0 1px 0 rgba(255,255,255,.2);
  144. @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);
  145. .box-shadow(@shadow);
  146. }
  147. // Mixin for generating new styles
  148. .alert-styles(@color) {
  149. #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));
  150. border-color: darken(@color, 15%);
  151. }
  152. // Apply the mixin to the alerts
  153. .alert-success { .alert-styles(@alert-success-bg); }
  154. .alert-info { .alert-styles(@alert-info-bg); }
  155. .alert-warning { .alert-styles(@alert-warning-bg); }
  156. .alert-danger { .alert-styles(@alert-danger-bg); }
  157. //
  158. // Progress bars
  159. // --------------------------------------------------
  160. // Give the progress background some depth
  161. .progress {
  162. #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)
  163. }
  164. // Mixin for generating new styles
  165. .progress-bar-styles(@color) {
  166. #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));
  167. }
  168. // Apply the mixin to the progress bars
  169. .progress-bar { .progress-bar-styles(@progress-bar-bg); }
  170. .progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); }
  171. .progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); }
  172. .progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }
  173. .progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }
  174. // Reset the striped class because our mixins don't do multiple gradients and
  175. // the above custom styles override the new `.progress-bar-striped` in v3.2.0.
  176. .progress-bar-striped {
  177. #gradient > .striped();
  178. }
  179. //
  180. // List groups
  181. // --------------------------------------------------
  182. .list-group {
  183. border-radius: @border-radius-base;
  184. .box-shadow(0 1px 2px rgba(0,0,0,.075));
  185. }
  186. .list-group-item.active,
  187. .list-group-item.active:hover,
  188. .list-group-item.active:focus {
  189. text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);
  190. #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));
  191. border-color: darken(@list-group-active-border, 7.5%);
  192. .badge {
  193. text-shadow: none;
  194. }
  195. }
  196. //
  197. // Panels
  198. // --------------------------------------------------
  199. // Common styles
  200. .panel {
  201. .box-shadow(0 1px 2px rgba(0,0,0,.05));
  202. }
  203. // Mixin for generating new styles
  204. .panel-heading-styles(@color) {
  205. #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));
  206. }
  207. // Apply the mixin to the panel headings only
  208. .panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); }
  209. .panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); }
  210. .panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); }
  211. .panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); }
  212. .panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); }
  213. .panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); }
  214. //
  215. // Wells
  216. // --------------------------------------------------
  217. .well {
  218. #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);
  219. border-color: darken(@well-bg, 10%);
  220. @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);
  221. .box-shadow(@shadow);
  222. }