You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
6.9 KiB

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