theme.less 7.0 KB

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