twitter-bootswatch-rails 2.3.2.8 → 3.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +8 -8
  2. data/lib/generators/bootswatch/import/import_generator.rb +4 -5
  3. data/lib/generators/bootswatch/install/install_generator.rb +4 -6
  4. data/lib/generators/bootswatch/install/templates/bootstrap.less +29 -33
  5. data/lib/generators/bootswatch/install/templates/bootswatch.css.less.tt +0 -4
  6. data/lib/generators/bootswatch/install/templates/bootswatch.js.tt +3 -0
  7. data/lib/generators/bootswatch/install/templates/loader.css.less.tt +1 -1
  8. data/lib/generators/bootswatch/install/templates/loader.js.tt +10 -0
  9. data/lib/generators/bootswatch/install/templates/mixins.less.tt +487 -466
  10. data/lib/generators/bootswatch/install/templates/variables.less.tt +498 -179
  11. data/lib/generators/bootswatch/layout/templates/layout.html.erb +349 -18
  12. data/lib/generators/bootswatch/layout/templates/layout.html.haml +0 -5
  13. data/lib/generators/bootswatch/layout/templates/layout.html.slim +0 -5
  14. data/lib/twitter/bootswatch/rails/version.rb +1 -1
  15. data/vendor/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.eot +0 -0
  16. data/vendor/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.svg +228 -0
  17. data/vendor/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  18. data/vendor/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff +0 -0
  19. data/vendor/assets/javascripts/twitter/bootstrap/affix.js +126 -0
  20. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +98 -0
  21. data/vendor/assets/javascripts/twitter/bootstrap/button.js +109 -0
  22. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +217 -0
  23. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +179 -0
  24. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +154 -0
  25. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +246 -0
  26. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +117 -0
  27. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +158 -0
  28. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +135 -0
  29. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +386 -0
  30. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +56 -0
  31. data/vendor/toolkit/twitter/bootstrap/alerts.less +46 -58
  32. data/vendor/toolkit/twitter/bootstrap/badges.less +51 -0
  33. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +29 -33
  34. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +7 -8
  35. data/vendor/toolkit/twitter/bootstrap/button-groups.less +173 -154
  36. data/vendor/toolkit/twitter/bootstrap/buttons.less +97 -165
  37. data/vendor/toolkit/twitter/bootstrap/carousel.less +115 -64
  38. data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
  39. data/vendor/toolkit/twitter/bootstrap/code.less +17 -22
  40. data/vendor/toolkit/twitter/bootstrap/component-animations.less +10 -3
  41. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +92 -147
  42. data/vendor/toolkit/twitter/bootstrap/forms.less +224 -561
  43. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +232 -0
  44. data/vendor/toolkit/twitter/bootstrap/grid.less +336 -11
  45. data/vendor/toolkit/twitter/bootstrap/input-groups.less +127 -0
  46. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +40 -0
  47. data/vendor/toolkit/twitter/bootstrap/labels.less +58 -0
  48. data/vendor/toolkit/twitter/bootstrap/list-group.less +88 -0
  49. data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
  50. data/vendor/toolkit/twitter/bootstrap/mixins.less +487 -466
  51. data/vendor/toolkit/twitter/bootstrap/modals.less +98 -52
  52. data/vendor/toolkit/twitter/bootstrap/navbar.less +507 -383
  53. data/vendor/toolkit/twitter/bootstrap/navs.less +169 -349
  54. data/vendor/toolkit/twitter/bootstrap/normalize.less +396 -0
  55. data/vendor/toolkit/twitter/bootstrap/pager.less +45 -33
  56. data/vendor/toolkit/twitter/bootstrap/pagination.less +65 -105
  57. data/vendor/toolkit/twitter/bootstrap/panels.less +148 -0
  58. data/vendor/toolkit/twitter/bootstrap/popovers.less +51 -51
  59. data/vendor/toolkit/twitter/bootstrap/print.less +100 -0
  60. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +28 -55
  61. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +195 -34
  62. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +101 -24
  63. data/vendor/toolkit/twitter/bootstrap/tables.less +170 -178
  64. data/vendor/toolkit/twitter/bootstrap/theme.less +232 -0
  65. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +11 -33
  66. data/vendor/toolkit/twitter/bootstrap/tooltip.less +45 -20
  67. data/vendor/toolkit/twitter/bootstrap/type.less +101 -110
  68. data/vendor/toolkit/twitter/bootstrap/utilities.less +19 -7
  69. data/vendor/toolkit/twitter/bootstrap/variables.less +498 -179
  70. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  71. metadata +33 -36
  72. data/lib/generators/bootswatch/install/templates/bootswatch.js.coffee.tt +0 -9
  73. data/lib/generators/bootswatch/install/templates/loader.coffee.tt +0 -23
  74. data/lib/generators/bootswatch/install/templates/responsive.less.tt +0 -51
  75. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  76. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  77. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  78. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  79. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  80. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  81. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  82. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  83. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  84. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  85. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  86. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  87. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  88. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  89. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  90. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  91. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  92. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  93. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  94. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  95. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  96. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  97. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  98. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  99. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  100. data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODI5NjY2NTIzYWM5MzNkMDE4YjA2ZjY5MDkzZjEyMmE5ZDI0MThkYg==
4
+ MzFlMWY3ZmY3MDQ1NjljY2RlMTg1YjhjODVlZmZhYmE2NmRhYjJiMQ==
5
5
  data.tar.gz: !binary |-
6
- YTlmMzBkMWYxY2U3MjcxMWY5MWRjMzIyMDg5YWJmODYyMjcyYmRmYw==
6
+ M2EzYjZlYmE0YjdlYTZiODlhNzRmNDRkY2I2YzdhZGU1OWJjMzI0NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWQ4ZTg1NTFiMmU2M2YzOThmNWQyMWM0YmYxN2JlNmFmOGE2Nzg5MTExMzAz
10
- MGI5ZmY3YjUxMjY4NmRjNWFmODQzZDc1ZmQxYzk1YzNhZmRmNGQ4ZTY4NTU0
11
- NmFmNDJjY2I0OWViMGI4NThkODVhMTU5YmI5NTZkNTU1ZTc4MWM=
9
+ ODQ0YTQxMjgxMTBmZjcyZDZmOWM1YTY0NDcwMDdkZDU1NmE4YTllYjU3MDgw
10
+ YmFhZWIyZjZjMWI4OWNjMGYxY2M3ODE3NWZiYWRlOGQ1MGI2MTVmY2JiYmQ4
11
+ NWUxNTE3MmY2MjA5ZjllOTU3ZTQ0MjM3MjMxMTA0ZWJjMzk3MTM=
12
12
  data.tar.gz: !binary |-
13
- N2QwODc4MjZkMWE4OTUzNDI4Y2UxZTBmYWZkMThhZGU3YjM3OWRiZTY2N2Qy
14
- ZmIyNjFiZjFmODdhODNiZGNhNWQ2ODkwNDAwYjU4MzgwNTA5NTg3YmEyY2Fl
15
- NGJlNjU1ZTY4ZjJhMGNjYjQ0YWYyYmYxNDE5ZGViMTU1YmFkOWU=
13
+ OGMwZGQ0NWYyOTNmMGE0MDkwZGFmOWI3NjZkZWFiNjAxNzU3Y2ZhOWE5NmZk
14
+ OTY1MDUyOGQyZWM2NTEwMTU1NTYwMWQ5YWM4ZDZjOGI0OGEyNDlhODdkZWY5
15
+ NzZiMmQxOTBhNmI5ZDkzZjIzNjZhMDdhMTk5NzViZjVjMzUwNDY=
@@ -17,8 +17,7 @@ module Bootswatch
17
17
  end
18
18
 
19
19
  def theme_repo_url
20
- #TODO: change for 3.0.0 release
21
- "https://raw.github.com/thomaspark/bootswatch/gh-pages/2/#{theme_name}"
20
+ "https://raw.github.com/thomaspark/bootswatch/gh-pages/#{theme_name}"
22
21
  end
23
22
 
24
23
  def import_less
@@ -39,9 +38,9 @@ module Bootswatch
39
38
  '"../img/glyphicons-halflings.png"',
40
39
  '"twitter/bootstrap/glyphicons-halflings.png"'
41
40
 
42
- gsub_file File.join(stylesheets_dest_path,'variables.less'),
43
- '"../img/glyphicons-halflings-white.png"',
44
- '"twitter/bootstrap/glyphicons-halflings-white.png"'
41
+ gsub_file File.join(stylesheets_dest_path, 'variables.less'),
42
+ '"../fonts/"',
43
+ '"twitter/bootstrap/"'
45
44
 
46
45
  end
47
46
 
@@ -72,14 +72,14 @@ module Bootswatch
72
72
  javascripts_dest_path = "app/assets/javascripts/#{theme_name}"
73
73
  empty_directory javascripts_dest_path
74
74
 
75
- template 'loader.coffee.tt', File.join(javascripts_dest_path,'loader.coffee'), {theme_name: theme_name, theme_info: theme_info}
75
+ template 'loader.js.tt', File.join(javascripts_dest_path,'loader.js'), {theme_name: theme_name, theme_info: theme_info}
76
76
 
77
77
  # upgrade to new extension to trigger recompile
78
- if File.exist?(File.join(javascripts_dest_path,'bootswatch.coffee'))
79
- File.rename(File.join(javascripts_dest_path,'bootswatch.coffee'), File.join(javascripts_dest_path,'bootswatch.js.coffee'))
78
+ if File.exist?(File.join(javascripts_dest_path,'bootswatch.js'))
79
+ File.rename(File.join(javascripts_dest_path,'bootswatch.js'), File.join(javascripts_dest_path,'bootswatch.js'))
80
80
  end
81
81
 
82
- template 'bootswatch.js.coffee.tt', File.join(javascripts_dest_path,'bootswatch.js.coffee'), {theme_name: theme_name, theme_info: theme_info}
82
+ template 'bootswatch.js.tt', File.join(javascripts_dest_path,'bootswatch.js'), {theme_name: theme_name, theme_info: theme_info}
83
83
 
84
84
  end
85
85
 
@@ -92,8 +92,6 @@ module Bootswatch
92
92
 
93
93
  template 'loader.css.less.tt', File.join(stylesheets_dest_path,'loader.css.less'), {less_imports: bootstrap_less_imports, theme_name: theme_name, theme_info: theme_info}
94
94
 
95
- template 'responsive.less.tt', File.join(stylesheets_dest_path,'responsive.less'), {theme_name: theme_name, theme_info: theme_info}
96
-
97
95
  # now variables and mixins
98
96
 
99
97
  template 'variables.less.tt', File.join(stylesheets_dest_path,'variables.less'), {theme_name: theme_name, theme_info: theme_info}
@@ -1,63 +1,59 @@
1
1
  /*!
2
- * Bootstrap v2.3.2
2
+ * Bootstrap v3.0.0
3
3
  *
4
- * Copyright 2012 Twitter, Inc
4
+ * Copyright 2013 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
6
6
  * http://www.apache.org/licenses/LICENSE-2.0
7
7
  *
8
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
8
+ * Designed and built with all the love in the world by @mdo and @fat.
9
9
  */
10
10
 
11
11
  // Core variables and mixins
12
- @import "variables.less"; // Modify this for custom colors, font-sizes, etc
12
+ @import "variables.less";
13
13
  @import "mixins.less";
14
14
 
15
- // CSS Reset
16
- @import "reset.less";
15
+ // Reset
16
+ @import "normalize.less";
17
+ @import "print.less";
17
18
 
18
- // Grid system and page structure
19
+ // Core CSS
19
20
  @import "scaffolding.less";
20
- @import "grid.less";
21
- @import "layouts.less";
22
-
23
- // Base CSS
24
21
  @import "type.less";
25
22
  @import "code.less";
26
- @import "forms.less";
23
+ @import "grid.less";
27
24
  @import "tables.less";
25
+ @import "forms.less";
26
+ @import "buttons.less";
28
27
 
29
- // Components: common
30
- @import "sprites.less";
31
- @import "dropdowns.less";
32
- @import "wells.less";
28
+ // Components
33
29
  @import "component-animations.less";
34
- @import "close.less";
35
-
36
- // Components: Buttons & Alerts
37
- @import "buttons.less";
30
+ @import "glyphicons.less";
31
+ @import "dropdowns.less";
38
32
  @import "button-groups.less";
39
- @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
40
-
41
- // Components: Nav
33
+ @import "input-groups.less";
42
34
  @import "navs.less";
43
35
  @import "navbar.less";
44
36
  @import "breadcrumbs.less";
45
37
  @import "pagination.less";
46
38
  @import "pager.less";
39
+ @import "labels.less";
40
+ @import "badges.less";
41
+ @import "jumbotron.less";
42
+ @import "thumbnails.less";
43
+ @import "alerts.less";
44
+ @import "progress-bars.less";
45
+ @import "media.less";
46
+ @import "list-group.less";
47
+ @import "panels.less";
48
+ @import "wells.less";
49
+ @import "close.less";
47
50
 
48
- // Components: Popovers
51
+ // Components w/ JavaScript
49
52
  @import "modals.less";
50
53
  @import "tooltip.less";
51
54
  @import "popovers.less";
52
-
53
- // Components: Misc
54
- @import "thumbnails.less";
55
- @import "media.less";
56
- @import "labels-badges.less";
57
- @import "progress-bars.less";
58
- @import "accordion.less";
59
55
  @import "carousel.less";
60
- @import "hero-unit.less";
61
56
 
62
57
  // Utility classes
63
- @import "utilities.less"; // Has to be last to override when necessary
58
+ @import "utilities.less";
59
+ @import "responsive-utilities.less";
@@ -3,7 +3,3 @@
3
3
  // <%= config[:theme_info] %>
4
4
  // Bootswatch
5
5
  // bootswatch.css.less
6
-
7
- //body {
8
- // padding-top: 10px;
9
- //}
@@ -0,0 +1,3 @@
1
+ // <%= config[:theme_info] %>
2
+ // Bootswatch
3
+ // bootswatch.js
@@ -18,4 +18,4 @@ end
18
18
  end
19
19
  %>
20
20
 
21
- // @import "<%= config[:theme_name] %>/responsive";
21
+ // @import "twitter/bootstrap/theme";
@@ -0,0 +1,10 @@
1
+ // <%= config[:theme_info] %>
2
+ // Bootswatch
3
+ // loader.js
4
+
5
+ <%
6
+ js_files = %w[transition alert button carousel collapse dropdown modal tooltip popover scrollspy tab affix]
7
+
8
+ js_files.each do |js_file|
9
+ %>//= require twitter/bootstrap/<%= js_file %>
10
+ <% end %>
@@ -6,21 +6,24 @@
6
6
  // --------------------------------------------------
7
7
 
8
8
 
9
- // UTILITY MIXINS
10
- // --------------------------------------------------
9
+ // Utilities
10
+ // -------------------------
11
11
 
12
12
  // Clearfix
13
- // --------
14
- // For clearing floats like a boss h5bp.com/q
15
- .clearfix {
16
- *zoom: 1;
13
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
14
+ //
15
+ // For modern browsers
16
+ // 1. The space content is one way to avoid an Opera bug when the
17
+ // contenteditable attribute is included anywhere else in the document.
18
+ // Otherwise it causes space to appear at the top and bottom of elements
19
+ // that are clearfixed.
20
+ // 2. The use of `table` rather than `block` is only necessary if using
21
+ // `:before` to contain the top-margins of child elements.
22
+ .clearfix() {
17
23
  &:before,
18
24
  &:after {
19
- display: table;
20
- content: "";
21
- // Fixes Opera/contenteditable bug:
22
- // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
23
- line-height: 0;
25
+ content: " "; /* 1 */
26
+ display: table; /* 2 */
24
27
  }
25
28
  &:after {
26
29
  clear: both;
@@ -28,7 +31,6 @@
28
31
  }
29
32
 
30
33
  // Webkit-style focus
31
- // ------------------
32
34
  .tab-focus() {
33
35
  // Default
34
36
  outline: thin dotted #333;
@@ -38,64 +40,30 @@
38
40
  }
39
41
 
40
42
  // Center-align a block level element
41
- // ----------------------------------
42
43
  .center-block() {
43
44
  display: block;
44
45
  margin-left: auto;
45
46
  margin-right: auto;
46
47
  }
47
48
 
48
- // IE7 inline-block
49
- // ----------------
50
- .ie7-inline-block() {
51
- *display: inline; /* IE7 inline-block hack */
52
- *zoom: 1;
53
- }
54
-
55
- // IE7 likes to collapse whitespace on either side of the inline-block elements.
56
- // Ems because we're attempting to match the width of a space character. Left
57
- // version is for form buttons, which typically come after other elements, and
58
- // right version is for icons, which come before. Applying both is ok, but it will
59
- // mean that space between those elements will be .6em (~2 space characters) in IE7,
60
- // instead of the 1 space in other browsers.
61
- .ie7-restore-left-whitespace() {
62
- *margin-left: .3em;
63
-
64
- &:first-child {
65
- *margin-left: 0;
66
- }
67
- }
68
-
69
- .ie7-restore-right-whitespace() {
70
- *margin-right: .3em;
71
- }
72
-
73
49
  // Sizing shortcuts
74
- // -------------------------
75
- .size(@height, @width) {
50
+ .size(@width; @height) {
76
51
  width: @width;
77
52
  height: @height;
78
53
  }
79
54
  .square(@size) {
80
- .size(@size, @size);
55
+ .size(@size; @size);
81
56
  }
82
57
 
83
58
  // Placeholder text
84
- // -------------------------
85
- .placeholder(@color: @placeholderText) {
86
- &:-moz-placeholder {
87
- color: @color;
88
- }
89
- &:-ms-input-placeholder {
90
- color: @color;
91
- }
92
- &::-webkit-input-placeholder {
93
- color: @color;
94
- }
59
+ .placeholder(@color: @input-color-placeholder) {
60
+ &:-moz-placeholder { color: @color; } // Firefox 4-18
61
+ &::-moz-placeholder { color: @color; } // Firefox 19+
62
+ &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
63
+ &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
95
64
  }
96
65
 
97
66
  // Text overflow
98
- // -------------------------
99
67
  // Requires inline-block or block for proper styling
100
68
  .text-overflow() {
101
69
  overflow: hidden;
@@ -104,10 +72,9 @@
104
72
  }
105
73
 
106
74
  // CSS image replacement
107
- // -------------------------
108
75
  // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
109
- .hide-text {
110
- font: 0/0 a;
76
+ .hide-text() {
77
+ font: ~"0/0" a;
111
78
  color: transparent;
112
79
  text-shadow: none;
113
80
  background-color: transparent;
@@ -115,233 +82,90 @@
115
82
  }
116
83
 
117
84
 
118
- // FONTS
119
- // --------------------------------------------------
120
-
121
- #font {
122
- #family {
123
- .serif() {
124
- font-family: @serifFontFamily;
125
- }
126
- .sans-serif() {
127
- font-family: @sansFontFamily;
128
- }
129
- .monospace() {
130
- font-family: @monoFontFamily;
131
- }
132
- }
133
- .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
134
- font-size: @size;
135
- font-weight: @weight;
136
- line-height: @lineHeight;
137
- }
138
- .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
139
- #font > #family > .serif;
140
- #font > .shorthand(@size, @weight, @lineHeight);
141
- }
142
- .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
143
- #font > #family > .sans-serif;
144
- #font > .shorthand(@size, @weight, @lineHeight);
145
- }
146
- .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
147
- #font > #family > .monospace;
148
- #font > .shorthand(@size, @weight, @lineHeight);
149
- }
150
- }
151
-
152
-
153
- // FORMS
154
- // --------------------------------------------------
155
-
156
- // Block level inputs
157
- .input-block-level {
158
- display: block;
159
- width: 100%;
160
- min-height: @inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
161
- .box-sizing(border-box); // Makes inputs behave like true block-level elements
162
- }
163
-
164
-
165
-
166
- // Mixin for form field states
167
- .formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
168
- // Set the text color
169
- .control-label,
170
- .help-block,
171
- .help-inline {
172
- color: @textColor;
173
- }
174
- // Style inputs accordingly
175
- .checkbox,
176
- .radio,
177
- input,
178
- select,
179
- textarea {
180
- color: @textColor;
181
- }
182
- input,
183
- select,
184
- textarea {
185
- border-color: @borderColor;
186
- .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
187
- &:focus {
188
- border-color: darken(@borderColor, 10%);
189
- @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
190
- .box-shadow(@shadow);
191
- }
192
- }
193
- // Give a small background color for input-prepend/-append
194
- .input-prepend .add-on,
195
- .input-append .add-on {
196
- color: @textColor;
197
- background-color: @backgroundColor;
198
- border-color: @textColor;
199
- }
200
- }
201
-
202
-
203
85
 
204
86
  // CSS3 PROPERTIES
205
87
  // --------------------------------------------------
206
88
 
207
- // Border Radius
208
- .border-radius(@radius) {
209
- -webkit-border-radius: @radius;
210
- -moz-border-radius: @radius;
211
- border-radius: @radius;
212
- }
213
-
214
- // Single Corner Border Radius
215
- .border-top-left-radius(@radius) {
216
- -webkit-border-top-left-radius: @radius;
217
- -moz-border-radius-topleft: @radius;
218
- border-top-left-radius: @radius;
219
- }
220
- .border-top-right-radius(@radius) {
221
- -webkit-border-top-right-radius: @radius;
222
- -moz-border-radius-topright: @radius;
223
- border-top-right-radius: @radius;
224
- }
225
- .border-bottom-right-radius(@radius) {
226
- -webkit-border-bottom-right-radius: @radius;
227
- -moz-border-radius-bottomright: @radius;
228
- border-bottom-right-radius: @radius;
229
- }
230
- .border-bottom-left-radius(@radius) {
231
- -webkit-border-bottom-left-radius: @radius;
232
- -moz-border-radius-bottomleft: @radius;
233
- border-bottom-left-radius: @radius;
234
- }
235
-
236
- // Single Side Border Radius
89
+ // Single side border-radius
237
90
  .border-top-radius(@radius) {
238
- .border-top-right-radius(@radius);
239
- .border-top-left-radius(@radius);
91
+ border-top-right-radius: @radius;
92
+ border-top-left-radius: @radius;
240
93
  }
241
94
  .border-right-radius(@radius) {
242
- .border-top-right-radius(@radius);
243
- .border-bottom-right-radius(@radius);
95
+ border-bottom-right-radius: @radius;
96
+ border-top-right-radius: @radius;
244
97
  }
245
98
  .border-bottom-radius(@radius) {
246
- .border-bottom-right-radius(@radius);
247
- .border-bottom-left-radius(@radius);
99
+ border-bottom-right-radius: @radius;
100
+ border-bottom-left-radius: @radius;
248
101
  }
249
102
  .border-left-radius(@radius) {
250
- .border-top-left-radius(@radius);
251
- .border-bottom-left-radius(@radius);
103
+ border-bottom-left-radius: @radius;
104
+ border-top-left-radius: @radius;
252
105
  }
253
106
 
254
107
  // Drop shadows
255
108
  .box-shadow(@shadow) {
256
- -webkit-box-shadow: @shadow;
257
- -moz-box-shadow: @shadow;
109
+ -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
258
110
  box-shadow: @shadow;
259
111
  }
260
112
 
261
113
  // Transitions
262
114
  .transition(@transition) {
263
115
  -webkit-transition: @transition;
264
- -moz-transition: @transition;
265
- -o-transition: @transition;
266
116
  transition: @transition;
267
117
  }
268
118
  .transition-delay(@transition-delay) {
269
119
  -webkit-transition-delay: @transition-delay;
270
- -moz-transition-delay: @transition-delay;
271
- -o-transition-delay: @transition-delay;
272
120
  transition-delay: @transition-delay;
273
121
  }
274
122
  .transition-duration(@transition-duration) {
275
123
  -webkit-transition-duration: @transition-duration;
276
- -moz-transition-duration: @transition-duration;
277
- -o-transition-duration: @transition-duration;
278
124
  transition-duration: @transition-duration;
279
125
  }
126
+ .transition-transform(@transition) {
127
+ -webkit-transition: -webkit-transform @transition;
128
+ -moz-transition: -moz-transform @transition;
129
+ -o-transition: -o-transform @transition;
130
+ transition: transform @transition;
131
+ }
280
132
 
281
133
  // Transformations
282
134
  .rotate(@degrees) {
283
135
  -webkit-transform: rotate(@degrees);
284
- -moz-transform: rotate(@degrees);
285
- -ms-transform: rotate(@degrees);
286
- -o-transform: rotate(@degrees);
136
+ -ms-transform: rotate(@degrees); // IE9+
287
137
  transform: rotate(@degrees);
288
138
  }
289
139
  .scale(@ratio) {
290
140
  -webkit-transform: scale(@ratio);
291
- -moz-transform: scale(@ratio);
292
- -ms-transform: scale(@ratio);
293
- -o-transform: scale(@ratio);
141
+ -ms-transform: scale(@ratio); // IE9+
294
142
  transform: scale(@ratio);
295
143
  }
296
- .translate(@x, @y) {
144
+ .translate(@x; @y) {
297
145
  -webkit-transform: translate(@x, @y);
298
- -moz-transform: translate(@x, @y);
299
- -ms-transform: translate(@x, @y);
300
- -o-transform: translate(@x, @y);
146
+ -ms-transform: translate(@x, @y); // IE9+
301
147
  transform: translate(@x, @y);
302
148
  }
303
- .skew(@x, @y) {
149
+ .skew(@x; @y) {
304
150
  -webkit-transform: skew(@x, @y);
305
- -moz-transform: skew(@x, @y);
306
- -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885
307
- -o-transform: skew(@x, @y);
151
+ -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
308
152
  transform: skew(@x, @y);
309
- -webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319
310
153
  }
311
- .translate3d(@x, @y, @z) {
154
+ .translate3d(@x; @y; @z) {
312
155
  -webkit-transform: translate3d(@x, @y, @z);
313
- -moz-transform: translate3d(@x, @y, @z);
314
- -o-transform: translate3d(@x, @y, @z);
315
156
  transform: translate3d(@x, @y, @z);
316
157
  }
317
158
 
318
159
  // Backface visibility
319
160
  // Prevent browsers from flickering when using CSS 3D transforms.
320
- // Default value is `visible`, but can be changed to `hidden
161
+ // Default value is `visible`, but can be changed to `hidden`
321
162
  // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
322
163
  .backface-visibility(@visibility){
323
- -webkit-backface-visibility: @visibility;
324
- -moz-backface-visibility: @visibility;
325
- backface-visibility: @visibility;
164
+ -webkit-backface-visibility: @visibility;
165
+ -moz-backface-visibility: @visibility;
166
+ backface-visibility: @visibility;
326
167
  }
327
168
 
328
- // Background clipping
329
- // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
330
- .background-clip(@clip) {
331
- -webkit-background-clip: @clip;
332
- -moz-background-clip: @clip;
333
- background-clip: @clip;
334
- }
335
-
336
- // Background sizing
337
- .background-size(@size) {
338
- -webkit-background-size: @size;
339
- -moz-background-size: @size;
340
- -o-background-size: @size;
341
- background-size: @size;
342
- }
343
-
344
-
345
169
  // Box sizing
346
170
  .box-sizing(@boxmodel) {
347
171
  -webkit-box-sizing: @boxmodel;
@@ -354,7 +178,7 @@
354
178
  .user-select(@select) {
355
179
  -webkit-user-select: @select;
356
180
  -moz-user-select: @select;
357
- -ms-user-select: @select;
181
+ -ms-user-select: @select; // IE10+
358
182
  -o-user-select: @select;
359
183
  user-select: @select;
360
184
  }
@@ -366,13 +190,13 @@
366
190
  }
367
191
 
368
192
  // CSS3 Content Columns
369
- .content-columns(@columnCount, @columnGap: @gridGutterWidth) {
370
- -webkit-column-count: @columnCount;
371
- -moz-column-count: @columnCount;
372
- column-count: @columnCount;
373
- -webkit-column-gap: @columnGap;
374
- -moz-column-gap: @columnGap;
375
- column-gap: @columnGap;
193
+ .content-columns(@column-count; @column-gap: @grid-gutter-width) {
194
+ -webkit-column-count: @column-count;
195
+ -moz-column-count: @column-count;
196
+ column-count: @column-count;
197
+ -webkit-column-gap: @column-gap;
198
+ -moz-column-gap: @column-gap;
199
+ column-gap: @column-gap;
376
200
  }
377
201
 
378
202
  // Optional hyphenation
@@ -380,168 +204,321 @@
380
204
  word-wrap: break-word;
381
205
  -webkit-hyphens: @mode;
382
206
  -moz-hyphens: @mode;
383
- -ms-hyphens: @mode;
207
+ -ms-hyphens: @mode; // IE10+
384
208
  -o-hyphens: @mode;
385
209
  hyphens: @mode;
386
210
  }
387
211
 
388
212
  // Opacity
389
213
  .opacity(@opacity) {
390
- opacity: @opacity / 100;
391
- filter: ~"alpha(opacity=@{opacity})";
214
+ opacity: @opacity;
215
+ // IE8 filter
216
+ @opacity-ie: (@opacity * 100);
217
+ filter: ~"alpha(opacity=@{opacity-ie})";
392
218
  }
393
219
 
394
220
 
395
221
 
396
- // BACKGROUNDS
222
+ // GRADIENTS
397
223
  // --------------------------------------------------
398
224
 
399
- // Add an alphatransparency value to any background or border color (via Elyse Holladay)
400
- #translucent {
401
- .background(@color: @white, @alpha: 1) {
402
- background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
403
- }
404
- .border(@color: @white, @alpha: 1) {
405
- border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
406
- .background-clip(padding-box);
407
- }
408
- }
409
-
410
- // Gradient Bar Colors for buttons and alerts
411
- .gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
412
- color: @textColor;
413
- text-shadow: @textShadow;
414
- #gradient > .vertical(@primaryColor, @secondaryColor);
415
- border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
416
- border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
417
- }
418
-
419
- // Gradients
420
225
  #gradient {
421
- .horizontal(@startColor: #555, @endColor: #333) {
422
- background-color: @endColor;
423
- background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
424
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
425
- background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
426
- background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
427
- background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
226
+
227
+ // Horizontal gradient, from left to right
228
+ //
229
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
230
+ // Color stops are not available in IE9 and below.
231
+ .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
232
+ background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
233
+ background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
234
+ background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
235
+ background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
428
236
  background-repeat: repeat-x;
429
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
430
- }
431
- .vertical(@startColor: #555, @endColor: #333) {
432
- background-color: mix(@startColor, @endColor, 60%);
433
- background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
434
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
435
- background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
436
- background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
437
- background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
237
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
238
+ }
239
+
240
+ // Vertical gradient, from top to bottom
241
+ //
242
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
243
+ // Color stops are not available in IE9 and below.
244
+ .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
245
+ background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
246
+ background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
247
+ background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
248
+ background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
438
249
  background-repeat: repeat-x;
439
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
250
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
440
251
  }
441
- .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
442
- background-color: @endColor;
252
+
253
+ .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
443
254
  background-repeat: repeat-x;
444
- background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
445
- background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
446
- background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
447
- background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
448
- }
449
- .horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
450
- background-color: mix(@midColor, @endColor, 80%);
451
- background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
452
- background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
453
- background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
454
- background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
455
- background-image: linear-gradient(to right, @startColor, @midColor @colorStop, @endColor);
255
+ background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
256
+ background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
257
+ background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
258
+ }
259
+ .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
260
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
261
+ background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
262
+ background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
263
+ background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
456
264
  background-repeat: no-repeat;
457
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
265
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
458
266
  }
459
-
460
- .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
461
- background-color: mix(@midColor, @endColor, 80%);
462
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
463
- background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
464
- background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
465
- background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
466
- background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
267
+ .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
268
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
269
+ background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
270
+ background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
271
+ background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
467
272
  background-repeat: no-repeat;
468
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
469
- }
470
- .radial(@innerColor: #555, @outerColor: #333) {
471
- background-color: @outerColor;
472
- background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
473
- background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
474
- background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
475
- background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
273
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
274
+ }
275
+ .radial(@inner-color: #555; @outer-color: #333) {
276
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
277
+ background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
278
+ background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
279
+ background-image: radial-gradient(circle, @inner-color, @outer-color);
476
280
  background-repeat: no-repeat;
477
281
  }
478
- .striped(@color: #555, @angle: 45deg) {
479
- background-color: @color;
282
+ .striped(@color: #555; @angle: 45deg) {
480
283
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
481
284
  background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
482
285
  background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
483
- background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
484
286
  background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
485
287
  }
486
288
  }
289
+
487
290
  // Reset filters for IE
291
+ //
292
+ // When you need to remove a gradient background, do not forget to use this to reset
293
+ // the IE filter for IE9 and below.
488
294
  .reset-filter() {
489
295
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
490
296
  }
491
297
 
492
298
 
493
299
 
300
+ // Retina images
301
+ //
302
+ // Short retina mixin for setting background-image and -size
303
+
304
+ .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
305
+ background-image: asset-url("@{file-1x}");
306
+
307
+ @media
308
+ only screen and (-webkit-min-device-pixel-ratio: 2),
309
+ only screen and ( min--moz-device-pixel-ratio: 2),
310
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
311
+ only screen and ( min-device-pixel-ratio: 2),
312
+ only screen and ( min-resolution: 192dpi),
313
+ only screen and ( min-resolution: 2dppx) {
314
+ background-image: asset-url("@{file-2x}");
315
+ background-size: @width-1x @height-1x;
316
+ }
317
+ }
318
+
319
+
320
+ // Responsive image
321
+ //
322
+ // Keep images from scaling beyond the width of their parents.
323
+
324
+ .img-responsive(@display: block;) {
325
+ display: @display;
326
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
327
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
328
+ }
329
+
330
+
494
331
  // COMPONENT MIXINS
495
332
  // --------------------------------------------------
496
333
 
497
334
  // Horizontal dividers
498
335
  // -------------------------
499
336
  // Dividers (basically an hr) within dropdowns and nav lists
500
- .nav-divider(@top: #e5e5e5, @bottom: @white) {
501
- // IE7 needs a set width since we gave a height. Restricting just
502
- // to IE7 to keep the 1px left/right space in other browsers.
503
- // It is unclear where IE is getting the extra space that we need
504
- // to negative-margin away, but so it goes.
505
- *width: 100%;
337
+ .nav-divider(@color: #e5e5e5) {
506
338
  height: 1px;
507
- margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
508
- *margin: -5px 0 5px;
339
+ margin: ((@line-height-computed / 2) - 1) 0;
509
340
  overflow: hidden;
510
- background-color: @top;
511
- border-bottom: 1px solid @bottom;
341
+ background-color: @color;
342
+ }
343
+
344
+ // Panels
345
+ // -------------------------
346
+ .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border;) {
347
+ border-color: @border;
348
+ & > .panel-heading {
349
+ color: @heading-text-color;
350
+ background-color: @heading-bg-color;
351
+ border-color: @heading-border;
352
+ + .panel-collapse .panel-body {
353
+ border-top-color: @border;
354
+ }
355
+ }
356
+ & > .panel-footer {
357
+ + .panel-collapse .panel-body {
358
+ border-bottom-color: @border;
359
+ }
360
+ }
512
361
  }
513
362
 
514
- // Button backgrounds
515
- // ------------------
516
- .buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
517
- // gradientBar will set the background to a pleasing blend of these, to support IE<=9
518
- .gradientBar(@startColor, @endColor, @textColor, @textShadow);
519
- *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
520
- .reset-filter();
363
+ // Alerts
364
+ // -------------------------
365
+ .alert-variant(@background; @border; @text-color) {
366
+ background-color: @background;
367
+ border-color: @border;
368
+ color: @text-color;
369
+ hr {
370
+ border-top-color: darken(@border, 5%);
371
+ }
372
+ .alert-link {
373
+ color: darken(@text-color, 10%);
374
+ }
375
+ }
376
+
377
+ // Tables
378
+ // -------------------------
379
+ .table-row-variant(@state; @background; @border) {
380
+ // Exact selectors below required to override `.table-striped` and prevent
381
+ // inheritance to nested tables.
382
+ .table > thead > tr,
383
+ .table > tbody > tr,
384
+ .table > tfoot > tr {
385
+ > td.@{state},
386
+ > th.@{state},
387
+ &.@{state} > td,
388
+ &.@{state} > th {
389
+ background-color: @background;
390
+ border-color: @border;
391
+ }
392
+ }
521
393
 
522
- // in these cases the gradient won't cover the background, so we override
523
- &:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
524
- color: @textColor;
525
- background-color: @endColor;
526
- *background-color: darken(@endColor, 5%);
394
+ // Hover states for `.table-hover`
395
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
396
+ .table-hover > tbody > tr {
397
+ > td.@{state}:hover,
398
+ > th.@{state}:hover,
399
+ &.@{state}:hover > td {
400
+ background-color: darken(@background, 5%);
401
+ border-color: darken(@border, 5%);
402
+ }
527
403
  }
404
+ }
528
405
 
529
- // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
406
+ // Button variants
407
+ // -------------------------
408
+ // Easily pump out default styles, as well as :hover, :focus, :active,
409
+ // and disabled options for all buttons
410
+ .button-variant(@color; @background; @border) {
411
+ color: @color;
412
+ background-color: @background;
413
+ border-color: @border;
414
+
415
+ &:hover,
416
+ &:focus,
530
417
  &:active,
531
- &.active {
532
- background-color: darken(@endColor, 10%) e("\9");
418
+ &.active,
419
+ .open .dropdown-toggle& {
420
+ color: @color;
421
+ background-color: darken(@background, 8%);
422
+ border-color: darken(@border, 12%);
423
+ }
424
+ &:active,
425
+ &.active,
426
+ .open .dropdown-toggle& {
427
+ background-image: none;
428
+ }
429
+ &.disabled,
430
+ &[disabled],
431
+ fieldset[disabled] & {
432
+ &,
433
+ &:hover,
434
+ &:focus,
435
+ &:active,
436
+ &.active {
437
+ background-color: @background;
438
+ border-color: @border
439
+ }
440
+ }
441
+ }
442
+
443
+ // Button sizes
444
+ // -------------------------
445
+ .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
446
+ padding: @padding-vertical @padding-horizontal;
447
+ font-size: @font-size;
448
+ line-height: @line-height;
449
+ border-radius: @border-radius;
450
+ }
451
+
452
+ // Pagination
453
+ // -------------------------
454
+ .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
455
+ > li {
456
+ > a,
457
+ > span {
458
+ padding: @padding-vertical @padding-horizontal;
459
+ font-size: @font-size;
460
+ }
461
+ &:first-child {
462
+ > a,
463
+ > span {
464
+ .border-left-radius(@border-radius);
465
+ }
466
+ }
467
+ &:last-child {
468
+ > a,
469
+ > span {
470
+ .border-right-radius(@border-radius);
471
+ }
472
+ }
473
+ }
474
+ }
475
+
476
+ // Labels
477
+ // -------------------------
478
+ .label-variant(@color) {
479
+ background-color: @color;
480
+ &[href] {
481
+ &:hover,
482
+ &:focus {
483
+ background-color: darken(@color, 10%);
484
+ }
533
485
  }
534
486
  }
535
487
 
536
488
  // Navbar vertical align
537
489
  // -------------------------
538
490
  // Vertically center elements in the navbar.
539
- // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
540
- .navbarVerticalAlign(@elementHeight) {
541
- margin-top: (@navbarHeight - @elementHeight) / 2;
491
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
492
+ .navbar-vertical-align(@element-height) {
493
+ margin-top: ((@navbar-height - @element-height) / 2);
494
+ margin-bottom: ((@navbar-height - @element-height) / 2);
542
495
  }
543
496
 
497
+ // Progress bars
498
+ // -------------------------
499
+ .progress-bar-variant(@color) {
500
+ background-color: @color;
501
+ .progress-striped & {
502
+ #gradient > .striped(@color);
503
+ }
504
+ }
544
505
 
506
+ // Responsive utilities
507
+ // -------------------------
508
+ // More easily include all the states for responsive-utilities.less.
509
+ .responsive-visibility() {
510
+ display: block !important;
511
+ tr& { display: table-row !important; }
512
+ th&,
513
+ td& { display: table-cell !important; }
514
+ }
515
+
516
+ .responsive-invisibility() {
517
+ display: none !important;
518
+ tr& { display: none !important; }
519
+ th&,
520
+ td& { display: none !important; }
521
+ }
545
522
 
546
523
  // Grid System
547
524
  // -----------
@@ -550,156 +527,200 @@
550
527
  .container-fixed() {
551
528
  margin-right: auto;
552
529
  margin-left: auto;
530
+ padding-left: (@grid-gutter-width / 2);
531
+ padding-right: (@grid-gutter-width / 2);
553
532
  .clearfix();
554
533
  }
555
534
 
556
- // Table columns
557
- .tableColumns(@columnSpan: 1) {
558
- float: none; // undo default grid column styles
559
- width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
560
- margin-left: 0; // undo default grid column styles
561
- }
562
-
563
- // Make a Grid
564
- // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
565
- .makeRow() {
566
- margin-left: @gridGutterWidth * -1;
535
+ // Creates a wrapper for a series of columns
536
+ .make-row(@gutter: @grid-gutter-width) {
537
+ margin-left: (@gutter / -2);
538
+ margin-right: (@gutter / -2);
567
539
  .clearfix();
568
540
  }
569
- .makeColumn(@columns: 1, @offset: 0) {
541
+
542
+ // Generate the extra small columns
543
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
544
+ position: relative;
570
545
  float: left;
571
- margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
572
- width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
546
+ width: percentage((@columns / @grid-columns));
547
+ // Prevent columns from collapsing when empty
548
+ min-height: 1px;
549
+ // Inner gutter via padding
550
+ padding-left: (@gutter / 2);
551
+ padding-right: (@gutter / 2);
552
+ }
553
+
554
+ // Generate the small columns
555
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
556
+ position: relative;
557
+ // Prevent columns from collapsing when empty
558
+ min-height: 1px;
559
+ // Inner gutter via padding
560
+ padding-left: (@gutter / 2);
561
+ padding-right: (@gutter / 2);
562
+
563
+ // Calculate width based on number of columns available
564
+ @media (min-width: @screen-sm) {
565
+ float: left;
566
+ width: percentage((@columns / @grid-columns));
567
+ }
573
568
  }
574
569
 
575
- // The Grid
576
- #grid {
577
-
578
- .core (@gridColumnWidth, @gridGutterWidth) {
579
-
580
- .spanX (@index) when (@index > 0) {
581
- .span@{index} { .span(@index); }
582
- .spanX(@index - 1);
583
- }
584
- .spanX (0) {}
585
-
586
- .offsetX (@index) when (@index > 0) {
587
- .offset@{index} { .offset(@index); }
588
- .offsetX(@index - 1);
589
- }
590
- .offsetX (0) {}
591
-
592
- .offset (@columns) {
593
- margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
594
- }
595
-
596
- .span (@columns) {
597
- width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
598
- }
599
-
600
- .row {
601
- margin-left: @gridGutterWidth * -1;
602
- .clearfix();
603
- }
604
-
605
- [class*="span"] {
606
- float: left;
607
- min-height: 1px; // prevent collapsing columns
608
- margin-left: @gridGutterWidth;
609
- }
610
-
611
- // Set the container width, and override it for fixed navbars in media queries
612
- .container,
613
- .navbar-static-top .container,
614
- .navbar-fixed-top .container,
615
- .navbar-fixed-bottom .container { .span(@gridColumns); }
616
-
617
- // generate .spanX and .offsetX
618
- .spanX (@gridColumns);
619
- .offsetX (@gridColumns);
620
-
570
+ // Generate the small column offsets
571
+ .make-sm-column-offset(@columns) {
572
+ @media (min-width: @screen-sm) {
573
+ margin-left: percentage((@columns / @grid-columns));
621
574
  }
575
+ }
576
+ .make-sm-column-push(@columns) {
577
+ @media (min-width: @screen-sm) {
578
+ left: percentage((@columns / @grid-columns));
579
+ }
580
+ }
581
+ .make-sm-column-pull(@columns) {
582
+ @media (min-width: @screen-sm) {
583
+ right: percentage((@columns / @grid-columns));
584
+ }
585
+ }
622
586
 
623
- .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
624
-
625
- .spanX (@index) when (@index > 0) {
626
- .span@{index} { .span(@index); }
627
- .spanX(@index - 1);
628
- }
629
- .spanX (0) {}
630
-
631
- .offsetX (@index) when (@index > 0) {
632
- .offset@{index} { .offset(@index); }
633
- .offset@{index}:first-child { .offsetFirstChild(@index); }
634
- .offsetX(@index - 1);
635
- }
636
- .offsetX (0) {}
637
-
638
- .offset (@columns) {
639
- margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2);
640
- *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%);
641
- }
642
-
643
- .offsetFirstChild (@columns) {
644
- margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth);
645
- *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
646
- }
647
-
648
- .span (@columns) {
649
- width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
650
- *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
651
- }
587
+ // Generate the medium columns
588
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
589
+ position: relative;
590
+ // Prevent columns from collapsing when empty
591
+ min-height: 1px;
592
+ // Inner gutter via padding
593
+ padding-left: (@gutter / 2);
594
+ padding-right: (@gutter / 2);
652
595
 
653
- .row-fluid {
654
- width: 100%;
655
- .clearfix();
656
- [class*="span"] {
657
- .input-block-level();
658
- float: left;
659
- margin-left: @fluidGridGutterWidth;
660
- *margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
661
- }
662
- [class*="span"]:first-child {
663
- margin-left: 0;
664
- }
596
+ // Calculate width based on number of columns available
597
+ @media (min-width: @screen-md) {
598
+ float: left;
599
+ width: percentage((@columns / @grid-columns));
600
+ }
601
+ }
665
602
 
666
- // Space grid-sized controls properly if multiple per line
667
- .controls-row [class*="span"] + [class*="span"] {
668
- margin-left: @fluidGridGutterWidth;
669
- }
603
+ // Generate the large column offsets
604
+ .make-md-column-offset(@columns) {
605
+ @media (min-width: @screen-md) {
606
+ margin-left: percentage((@columns / @grid-columns));
607
+ }
608
+ }
609
+ .make-md-column-push(@columns) {
610
+ @media (min-width: @screen-md) {
611
+ left: percentage((@columns / @grid-columns));
612
+ }
613
+ }
614
+ .make-md-column-pull(@columns) {
615
+ @media (min-width: @screen-md) {
616
+ right: percentage((@columns / @grid-columns));
617
+ }
618
+ }
670
619
 
671
- // generate .spanX and .offsetX
672
- .spanX (@gridColumns);
673
- .offsetX (@gridColumns);
674
- }
620
+ // Generate the large columns
621
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
622
+ position: relative;
623
+ // Prevent columns from collapsing when empty
624
+ min-height: 1px;
625
+ // Inner gutter via padding
626
+ padding-left: (@gutter / 2);
627
+ padding-right: (@gutter / 2);
675
628
 
629
+ // Calculate width based on number of columns available
630
+ @media (min-width: @screen-lg) {
631
+ float: left;
632
+ width: percentage((@columns / @grid-columns));
676
633
  }
634
+ }
677
635
 
678
- .input(@gridColumnWidth, @gridGutterWidth) {
636
+ // Generate the large column offsets
637
+ .make-lg-column-offset(@columns) {
638
+ @media (min-width: @screen-lg) {
639
+ margin-left: percentage((@columns / @grid-columns));
640
+ }
641
+ }
642
+ .make-lg-column-push(@columns) {
643
+ @media (min-width: @screen-lg) {
644
+ left: percentage((@columns / @grid-columns));
645
+ }
646
+ }
647
+ .make-lg-column-pull(@columns) {
648
+ @media (min-width: @screen-lg) {
649
+ right: percentage((@columns / @grid-columns));
650
+ }
651
+ }
679
652
 
680
- .spanX (@index) when (@index > 0) {
681
- input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
682
- .spanX(@index - 1);
683
- }
684
- .spanX (0) {}
685
653
 
686
- .span(@columns) {
687
- width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14;
688
- }
654
+ // Form validation states
655
+ //
656
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
657
+ // and successes.
689
658
 
690
- input,
691
- textarea,
692
- .uneditable-input {
693
- margin-left: 0; // override margin-left from core grid system
659
+ .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
660
+ // Color the label and help text
661
+ .help-block,
662
+ .control-label {
663
+ color: @text-color;
664
+ }
665
+ // Set the border and box shadow on specific inputs to match
666
+ .form-control {
667
+ border-color: @border-color;
668
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
669
+ &:focus {
670
+ border-color: darken(@border-color, 10%);
671
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
672
+ .box-shadow(@shadow);
694
673
  }
674
+ }
675
+ // Set validation states also for addons
676
+ .input-group-addon {
677
+ color: @text-color;
678
+ border-color: @border-color;
679
+ background-color: @background-color;
680
+ }
681
+ }
695
682
 
696
- // Space grid-sized controls properly if multiple per line
697
- .controls-row [class*="span"] + [class*="span"] {
698
- margin-left: @gridGutterWidth;
699
- }
683
+ // Form control focus state
684
+ //
685
+ // Generate a customized focus state and for any input with the specified color,
686
+ // which defaults to the `@input-focus-border` variable.
687
+ //
688
+ // We highly encourage you to not customize the default value, but instead use
689
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
690
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
691
+ // usability and accessibility should be taken into account with any change.
692
+ //
693
+ // Example usage: change the default blue border and shadow to white for better
694
+ // contrast against a dark gray background.
695
+
696
+ .form-control-focus(@color: @input-border-focus) {
697
+ @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
698
+ &:focus {
699
+ border-color: @color;
700
+ outline: 0;
701
+ .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
702
+ }
703
+ }
700
704
 
701
- // generate .spanX
702
- .spanX (@gridColumns);
705
+ // Form control sizing
706
+ //
707
+ // Relative text size, padding, and border-radii changes for form controls. For
708
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
709
+ // element gets special love because it's special, and that's a fact!
710
+
711
+ .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
712
+ height: @input-height;
713
+ padding: @padding-vertical @padding-horizontal;
714
+ font-size: @font-size;
715
+ line-height: @line-height;
716
+ border-radius: @border-radius;
717
+
718
+ select& {
719
+ height: @input-height;
720
+ line-height: @input-height;
721
+ }
703
722
 
723
+ textarea& {
724
+ height: auto;
704
725
  }
705
726
  }