theme.less 7.5 KB

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