tennpipes-su 3.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.rdoc +70 -0
  4. data/Rakefile +22 -0
  5. data/lib/tennpipes-su.rb +35 -0
  6. data/lib/tennpipes-su/access_control.rb +191 -0
  7. data/lib/tennpipes-su/bootstrap-less/alerts.less +67 -0
  8. data/lib/tennpipes-su/bootstrap-less/badges.less +55 -0
  9. data/lib/tennpipes-su/bootstrap-less/bootstrap.less +49 -0
  10. data/lib/tennpipes-su/bootstrap-less/breadcrumbs.less +26 -0
  11. data/lib/tennpipes-su/bootstrap-less/button-groups.less +226 -0
  12. data/lib/tennpipes-su/bootstrap-less/buttons.less +155 -0
  13. data/lib/tennpipes-su/bootstrap-less/carousel.less +232 -0
  14. data/lib/tennpipes-su/bootstrap-less/close.less +33 -0
  15. data/lib/tennpipes-su/bootstrap-less/code.less +63 -0
  16. data/lib/tennpipes-su/bootstrap-less/component-animations.less +29 -0
  17. data/lib/tennpipes-su/bootstrap-less/dropdowns.less +213 -0
  18. data/lib/tennpipes-su/bootstrap-less/font-awesome/bordered-pulled.less +16 -0
  19. data/lib/tennpipes-su/bootstrap-less/font-awesome/core.less +12 -0
  20. data/lib/tennpipes-su/bootstrap-less/font-awesome/fixed-width.less +6 -0
  21. data/lib/tennpipes-su/bootstrap-less/font-awesome/font-awesome.less +17 -0
  22. data/lib/tennpipes-su/bootstrap-less/font-awesome/icons.less +412 -0
  23. data/lib/tennpipes-su/bootstrap-less/font-awesome/larger.less +13 -0
  24. data/lib/tennpipes-su/bootstrap-less/font-awesome/list.less +19 -0
  25. data/lib/tennpipes-su/bootstrap-less/font-awesome/mixins.less +20 -0
  26. data/lib/tennpipes-su/bootstrap-less/font-awesome/path.less +14 -0
  27. data/lib/tennpipes-su/bootstrap-less/font-awesome/rotated-flipped.less +9 -0
  28. data/lib/tennpipes-su/bootstrap-less/font-awesome/spinning.less +30 -0
  29. data/lib/tennpipes-su/bootstrap-less/font-awesome/stacked.less +20 -0
  30. data/lib/tennpipes-su/bootstrap-less/font-awesome/variables.less +381 -0
  31. data/lib/tennpipes-su/bootstrap-less/forms.less +419 -0
  32. data/lib/tennpipes-su/bootstrap-less/glyphicons.less +233 -0
  33. data/lib/tennpipes-su/bootstrap-less/grid.less +100 -0
  34. data/lib/tennpipes-su/bootstrap-less/input-groups.less +157 -0
  35. data/lib/tennpipes-su/bootstrap-less/jumbotron.less +44 -0
  36. data/lib/tennpipes-su/bootstrap-less/labels.less +64 -0
  37. data/lib/tennpipes-su/bootstrap-less/list-group.less +110 -0
  38. data/lib/tennpipes-su/bootstrap-less/media.less +56 -0
  39. data/lib/tennpipes-su/bootstrap-less/mixins.less +926 -0
  40. data/lib/tennpipes-su/bootstrap-less/modals.less +138 -0
  41. data/lib/tennpipes-su/bootstrap-less/navbar.less +616 -0
  42. data/lib/tennpipes-su/bootstrap-less/navs.less +242 -0
  43. data/lib/tennpipes-su/bootstrap-less/normalize.less +423 -0
  44. data/lib/tennpipes-su/bootstrap-less/pager.less +55 -0
  45. data/lib/tennpipes-su/bootstrap-less/pagination.less +88 -0
  46. data/lib/tennpipes-su/bootstrap-less/panels.less +230 -0
  47. data/lib/tennpipes-su/bootstrap-less/popovers.less +133 -0
  48. data/lib/tennpipes-su/bootstrap-less/print.less +101 -0
  49. data/lib/tennpipes-su/bootstrap-less/progress-bars.less +80 -0
  50. data/lib/tennpipes-su/bootstrap-less/responsive-utilities.less +93 -0
  51. data/lib/tennpipes-su/bootstrap-less/scaffolding.less +134 -0
  52. data/lib/tennpipes-su/bootstrap-less/tables.less +233 -0
  53. data/lib/tennpipes-su/bootstrap-less/tennpipes-su.less +18 -0
  54. data/lib/tennpipes-su/bootstrap-less/theme.less +247 -0
  55. data/lib/tennpipes-su/bootstrap-less/thumbnails.less +36 -0
  56. data/lib/tennpipes-su/bootstrap-less/tooltip.less +95 -0
  57. data/lib/tennpipes-su/bootstrap-less/type.less +296 -0
  58. data/lib/tennpipes-su/bootstrap-less/utilities.less +56 -0
  59. data/lib/tennpipes-su/bootstrap-less/variables.less +827 -0
  60. data/lib/tennpipes-su/bootstrap-less/wells.less +29 -0
  61. data/lib/tennpipes-su/generators/actions.rb +78 -0
  62. data/lib/tennpipes-su/generators/admin_app.rb +169 -0
  63. data/lib/tennpipes-su/generators/admin_page.rb +68 -0
  64. data/lib/tennpipes-su/generators/orm.rb +172 -0
  65. data/lib/tennpipes-su/generators/templates/account/activerecord.rb.tt +41 -0
  66. data/lib/tennpipes-su/generators/templates/account/couchrest.rb.tt +67 -0
  67. data/lib/tennpipes-su/generators/templates/account/datamapper.rb.tt +56 -0
  68. data/lib/tennpipes-su/generators/templates/account/dynamoid.rb.tt +55 -0
  69. data/lib/tennpipes-su/generators/templates/account/minirecord.rb.tt +44 -0
  70. data/lib/tennpipes-su/generators/templates/account/mongoid.rb.tt +54 -0
  71. data/lib/tennpipes-su/generators/templates/account/mongomapper.rb.tt +47 -0
  72. data/lib/tennpipes-su/generators/templates/account/ohm.rb.tt +70 -0
  73. data/lib/tennpipes-su/generators/templates/account/seeds.rb.tt +29 -0
  74. data/lib/tennpipes-su/generators/templates/account/sequel.rb.tt +53 -0
  75. data/lib/tennpipes-su/generators/templates/app.rb.tt +42 -0
  76. data/lib/tennpipes-su/generators/templates/app/controllers/base.rb.tt +5 -0
  77. data/lib/tennpipes-su/generators/templates/app/controllers/sessions.rb.tt +29 -0
  78. data/lib/tennpipes-su/generators/templates/assets/images/favicon.ico +0 -0
  79. data/lib/tennpipes-su/generators/templates/assets/images/font/FontAwesome.otf +0 -0
  80. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.eot +0 -0
  81. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.svg +414 -0
  82. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.ttf +0 -0
  83. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.woff +0 -0
  84. data/lib/tennpipes-su/generators/templates/assets/images/logo.png +0 -0
  85. data/lib/tennpipes-su/generators/templates/assets/javascripts/application.js +118 -0
  86. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/affix.js +137 -0
  87. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/alert.js +88 -0
  88. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +6 -0
  89. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/button.js +107 -0
  90. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/carousel.js +205 -0
  91. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/collapse.js +170 -0
  92. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/dropdown.js +147 -0
  93. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/modal.js +243 -0
  94. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/popover.js +110 -0
  95. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/scrollspy.js +153 -0
  96. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/tab.js +125 -0
  97. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/tooltip.js +399 -0
  98. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/transition.js +48 -0
  99. data/lib/tennpipes-su/generators/templates/assets/javascripts/jquery-1.11.0.min.js +4 -0
  100. data/lib/tennpipes-su/generators/templates/assets/stylesheets/application.css +353 -0
  101. data/lib/tennpipes-su/generators/templates/assets/stylesheets/bootstrap.css +4 -0
  102. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/FontAwesome.otf +0 -0
  103. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.eot +0 -0
  104. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.svg +414 -0
  105. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.ttf +0 -0
  106. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.woff +0 -0
  107. data/lib/tennpipes-su/generators/templates/erb/app/base/index.erb.tt +15 -0
  108. data/lib/tennpipes-su/generators/templates/erb/app/errors/403.erb.tt +3 -0
  109. data/lib/tennpipes-su/generators/templates/erb/app/errors/404.erb.tt +3 -0
  110. data/lib/tennpipes-su/generators/templates/erb/app/errors/500.erb.tt +3 -0
  111. data/lib/tennpipes-su/generators/templates/erb/app/layouts/application.erb.tt +64 -0
  112. data/lib/tennpipes-su/generators/templates/erb/app/layouts/error.erb.tt +23 -0
  113. data/lib/tennpipes-su/generators/templates/erb/app/sessions/new.erb.tt +44 -0
  114. data/lib/tennpipes-su/generators/templates/erb/page/_form.erb.tt +18 -0
  115. data/lib/tennpipes-su/generators/templates/erb/page/edit.erb.tt +10 -0
  116. data/lib/tennpipes-su/generators/templates/erb/page/index.erb.tt +81 -0
  117. data/lib/tennpipes-su/generators/templates/erb/page/new.erb.tt +9 -0
  118. data/lib/tennpipes-su/generators/templates/haml/app/base/index.haml.tt +12 -0
  119. data/lib/tennpipes-su/generators/templates/haml/app/errors/403.haml.tt +3 -0
  120. data/lib/tennpipes-su/generators/templates/haml/app/errors/404.haml.tt +3 -0
  121. data/lib/tennpipes-su/generators/templates/haml/app/errors/500.haml.tt +3 -0
  122. data/lib/tennpipes-su/generators/templates/haml/app/layouts/application.haml.tt +49 -0
  123. data/lib/tennpipes-su/generators/templates/haml/app/layouts/error.haml.tt +18 -0
  124. data/lib/tennpipes-su/generators/templates/haml/app/sessions/new.haml.tt +38 -0
  125. data/lib/tennpipes-su/generators/templates/haml/page/_form.haml.tt +16 -0
  126. data/lib/tennpipes-su/generators/templates/haml/page/edit.haml.tt +8 -0
  127. data/lib/tennpipes-su/generators/templates/haml/page/index.haml.tt +58 -0
  128. data/lib/tennpipes-su/generators/templates/haml/page/new.haml.tt +7 -0
  129. data/lib/tennpipes-su/generators/templates/page/controller.rb.tt +92 -0
  130. data/lib/tennpipes-su/generators/templates/slim/app/base/index.slim.tt +12 -0
  131. data/lib/tennpipes-su/generators/templates/slim/app/errors/403.slim.tt +3 -0
  132. data/lib/tennpipes-su/generators/templates/slim/app/errors/404.slim.tt +3 -0
  133. data/lib/tennpipes-su/generators/templates/slim/app/errors/500.slim.tt +3 -0
  134. data/lib/tennpipes-su/generators/templates/slim/app/layouts/application.slim.tt +48 -0
  135. data/lib/tennpipes-su/generators/templates/slim/app/layouts/error.slim.tt +19 -0
  136. data/lib/tennpipes-su/generators/templates/slim/app/sessions/new.slim.tt +37 -0
  137. data/lib/tennpipes-su/generators/templates/slim/page/_form.slim.tt +16 -0
  138. data/lib/tennpipes-su/generators/templates/slim/page/edit.slim.tt +8 -0
  139. data/lib/tennpipes-su/generators/templates/slim/page/index.slim.tt +56 -0
  140. data/lib/tennpipes-su/generators/templates/slim/page/new.slim.tt +7 -0
  141. data/lib/tennpipes-su/helpers/authentication_helpers.rb +108 -0
  142. data/lib/tennpipes-su/helpers/view_helpers.rb +87 -0
  143. data/lib/tennpipes-su/locale/admin/cs.yml +56 -0
  144. data/lib/tennpipes-su/locale/admin/da.yml +56 -0
  145. data/lib/tennpipes-su/locale/admin/de.yml +56 -0
  146. data/lib/tennpipes-su/locale/admin/en.yml +56 -0
  147. data/lib/tennpipes-su/locale/admin/es.yml +56 -0
  148. data/lib/tennpipes-su/locale/admin/fr.yml +56 -0
  149. data/lib/tennpipes-su/locale/admin/hu.yml +56 -0
  150. data/lib/tennpipes-su/locale/admin/it.yml +56 -0
  151. data/lib/tennpipes-su/locale/admin/ja.yml +57 -0
  152. data/lib/tennpipes-su/locale/admin/lv.yml +56 -0
  153. data/lib/tennpipes-su/locale/admin/nl.yml +56 -0
  154. data/lib/tennpipes-su/locale/admin/no.yml +56 -0
  155. data/lib/tennpipes-su/locale/admin/pl.yml +56 -0
  156. data/lib/tennpipes-su/locale/admin/pt_br.yml +56 -0
  157. data/lib/tennpipes-su/locale/admin/ro.yml +56 -0
  158. data/lib/tennpipes-su/locale/admin/ru.yml +57 -0
  159. data/lib/tennpipes-su/locale/admin/sv.yml +56 -0
  160. data/lib/tennpipes-su/locale/admin/tr.yml +56 -0
  161. data/lib/tennpipes-su/locale/admin/uk.yml +56 -0
  162. data/lib/tennpipes-su/locale/admin/zh_cn.yml +56 -0
  163. data/lib/tennpipes-su/locale/admin/zh_tw.yml +56 -0
  164. data/lib/tennpipes-su/locale/orm/cs.yml +12 -0
  165. data/lib/tennpipes-su/locale/orm/da.yml +12 -0
  166. data/lib/tennpipes-su/locale/orm/de.yml +12 -0
  167. data/lib/tennpipes-su/locale/orm/en.yml +12 -0
  168. data/lib/tennpipes-su/locale/orm/es.yml +12 -0
  169. data/lib/tennpipes-su/locale/orm/fr.yml +12 -0
  170. data/lib/tennpipes-su/locale/orm/hu.yml +12 -0
  171. data/lib/tennpipes-su/locale/orm/it.yml +12 -0
  172. data/lib/tennpipes-su/locale/orm/ja.yml +12 -0
  173. data/lib/tennpipes-su/locale/orm/lv.yml +12 -0
  174. data/lib/tennpipes-su/locale/orm/nl.yml +12 -0
  175. data/lib/tennpipes-su/locale/orm/no.yml +12 -0
  176. data/lib/tennpipes-su/locale/orm/pl.yml +38 -0
  177. data/lib/tennpipes-su/locale/orm/pt_br.yml +12 -0
  178. data/lib/tennpipes-su/locale/orm/ro.yml +12 -0
  179. data/lib/tennpipes-su/locale/orm/ru.yml +12 -0
  180. data/lib/tennpipes-su/locale/orm/sv.yml +12 -0
  181. data/lib/tennpipes-su/locale/orm/tr.yml +12 -0
  182. data/lib/tennpipes-su/locale/orm/uk.yml +12 -0
  183. data/lib/tennpipes-su/locale/orm/zh_cn.yml +12 -0
  184. data/lib/tennpipes-su/locale/orm/zh_tw.yml +12 -0
  185. data/test/fixtures/sequel.rb +72 -0
  186. data/test/generators/test_account_model_generator.rb +108 -0
  187. data/test/generators/test_admin_app_generator.rb +218 -0
  188. data/test/generators/test_admin_page_generator.rb +140 -0
  189. data/test/helper.rb +47 -0
  190. data/test/test_admin_application.rb +271 -0
  191. data/test/test_locale.rb +25 -0
  192. metadata +298 -0
@@ -0,0 +1,56 @@
1
+ // Media objects
2
+ // Source: http://stubbornella.org/content/?p=497
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Common styles
7
+ // -------------------------
8
+
9
+ // Clear the floats
10
+ .media,
11
+ .media-body {
12
+ overflow: hidden;
13
+ zoom: 1;
14
+ }
15
+
16
+ // Proper spacing between instances of .media
17
+ .media,
18
+ .media .media {
19
+ margin-top: 15px;
20
+ }
21
+ .media:first-child {
22
+ margin-top: 0;
23
+ }
24
+
25
+ // For images and videos, set to block
26
+ .media-object {
27
+ display: block;
28
+ }
29
+
30
+ // Reset margins on headings for tighter default spacing
31
+ .media-heading {
32
+ margin: 0 0 5px;
33
+ }
34
+
35
+
36
+ // Media image alignment
37
+ // -------------------------
38
+
39
+ .media {
40
+ > .pull-left {
41
+ margin-right: 10px;
42
+ }
43
+ > .pull-right {
44
+ margin-left: 10px;
45
+ }
46
+ }
47
+
48
+
49
+ // Media list variation
50
+ // -------------------------
51
+
52
+ // Undo default ul/ol styles
53
+ .media-list {
54
+ padding-left: 0;
55
+ list-style: none;
56
+ }
@@ -0,0 +1,926 @@
1
+ //
2
+ // Mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Utilities
7
+ // -------------------------
8
+
9
+ // Clearfix
10
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
11
+ //
12
+ // For modern browsers
13
+ // 1. The space content is one way to avoid an Opera bug when the
14
+ // contenteditable attribute is included anywhere else in the document.
15
+ // Otherwise it causes space to appear at the top and bottom of elements
16
+ // that are clearfixed.
17
+ // 2. The use of `table` rather than `block` is only necessary if using
18
+ // `:before` to contain the top-margins of child elements.
19
+ .clearfix() {
20
+ &:before,
21
+ &:after {
22
+ content: " "; // 1
23
+ display: table; // 2
24
+ }
25
+ &:after {
26
+ clear: both;
27
+ }
28
+ }
29
+
30
+ // WebKit-style focus
31
+ .tab-focus() {
32
+ // Default
33
+ outline: thin dotted;
34
+ // WebKit
35
+ outline: 5px auto -webkit-focus-ring-color;
36
+ outline-offset: -2px;
37
+ }
38
+
39
+ // Center-align a block level element
40
+ .center-block() {
41
+ display: block;
42
+ margin-left: auto;
43
+ margin-right: auto;
44
+ }
45
+
46
+ // Sizing shortcuts
47
+ .size(@width; @height) {
48
+ width: @width;
49
+ height: @height;
50
+ }
51
+ .square(@size) {
52
+ .size(@size; @size);
53
+ }
54
+
55
+ // Placeholder text
56
+ .placeholder(@color: @input-color-placeholder) {
57
+ &:-moz-placeholder { color: @color; } // Firefox 4-18
58
+ &::-moz-placeholder { color: @color; // Firefox 19+
59
+ opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526
60
+ &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
61
+ &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
62
+ }
63
+
64
+ // Text overflow
65
+ // Requires inline-block or block for proper styling
66
+ .text-overflow() {
67
+ overflow: hidden;
68
+ text-overflow: ellipsis;
69
+ white-space: nowrap;
70
+ }
71
+
72
+ // CSS image replacement
73
+ //
74
+ // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
75
+ // mixins being reused as classes with the same name, this doesn't hold up. As
76
+ // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
77
+ // that we cannot chain the mixins together in Less, so they are repeated.
78
+ //
79
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
80
+
81
+ // Deprecated as of v3.0.1 (will be removed in v4)
82
+ .hide-text() {
83
+ font: ~"0/0" a;
84
+ color: transparent;
85
+ text-shadow: none;
86
+ background-color: transparent;
87
+ border: 0;
88
+ }
89
+ // New mixin to use as of v3.0.1
90
+ .text-hide() {
91
+ .hide-text();
92
+ }
93
+
94
+
95
+
96
+ // CSS3 PROPERTIES
97
+ // --------------------------------------------------
98
+
99
+ // Single side border-radius
100
+ .border-top-radius(@radius) {
101
+ border-top-right-radius: @radius;
102
+ border-top-left-radius: @radius;
103
+ }
104
+ .border-right-radius(@radius) {
105
+ border-bottom-right-radius: @radius;
106
+ border-top-right-radius: @radius;
107
+ }
108
+ .border-bottom-radius(@radius) {
109
+ border-bottom-right-radius: @radius;
110
+ border-bottom-left-radius: @radius;
111
+ }
112
+ .border-left-radius(@radius) {
113
+ border-bottom-left-radius: @radius;
114
+ border-top-left-radius: @radius;
115
+ }
116
+
117
+ // Drop shadows
118
+ //
119
+ // Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
120
+ // supported browsers that have box shadow capabilities now support the
121
+ // standard `box-shadow` property.
122
+ .box-shadow(@shadow) {
123
+ -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
124
+ box-shadow: @shadow;
125
+ }
126
+
127
+ // Transitions
128
+ .transition(@transition) {
129
+ -webkit-transition: @transition;
130
+ transition: @transition;
131
+ }
132
+ .transition-property(@transition-property) {
133
+ -webkit-transition-property: @transition-property;
134
+ transition-property: @transition-property;
135
+ }
136
+ .transition-delay(@transition-delay) {
137
+ -webkit-transition-delay: @transition-delay;
138
+ transition-delay: @transition-delay;
139
+ }
140
+ .transition-duration(@transition-duration) {
141
+ -webkit-transition-duration: @transition-duration;
142
+ transition-duration: @transition-duration;
143
+ }
144
+ .transition-transform(@transition) {
145
+ -webkit-transition: -webkit-transform @transition;
146
+ -moz-transition: -moz-transform @transition;
147
+ -o-transition: -o-transform @transition;
148
+ transition: transform @transition;
149
+ }
150
+
151
+ // Transformations
152
+ .rotate(@degrees) {
153
+ -webkit-transform: rotate(@degrees);
154
+ -ms-transform: rotate(@degrees); // IE9 only
155
+ transform: rotate(@degrees);
156
+ }
157
+ .scale(@ratio; @ratio-y...) {
158
+ -webkit-transform: scale(@ratio, @ratio-y);
159
+ -ms-transform: scale(@ratio, @ratio-y); // IE9 only
160
+ transform: scale(@ratio, @ratio-y);
161
+ }
162
+ .translate(@x; @y) {
163
+ -webkit-transform: translate(@x, @y);
164
+ -ms-transform: translate(@x, @y); // IE9 only
165
+ transform: translate(@x, @y);
166
+ }
167
+ .skew(@x; @y) {
168
+ -webkit-transform: skew(@x, @y);
169
+ -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
170
+ transform: skew(@x, @y);
171
+ }
172
+ .translate3d(@x; @y; @z) {
173
+ -webkit-transform: translate3d(@x, @y, @z);
174
+ transform: translate3d(@x, @y, @z);
175
+ }
176
+
177
+ .rotateX(@degrees) {
178
+ -webkit-transform: rotateX(@degrees);
179
+ -ms-transform: rotateX(@degrees); // IE9 only
180
+ transform: rotateX(@degrees);
181
+ }
182
+ .rotateY(@degrees) {
183
+ -webkit-transform: rotateY(@degrees);
184
+ -ms-transform: rotateY(@degrees); // IE9 only
185
+ transform: rotateY(@degrees);
186
+ }
187
+ .perspective(@perspective) {
188
+ -webkit-perspective: @perspective;
189
+ -moz-perspective: @perspective;
190
+ perspective: @perspective;
191
+ }
192
+ .perspective-origin(@perspective) {
193
+ -webkit-perspective-origin: @perspective;
194
+ -moz-perspective-origin: @perspective;
195
+ perspective-origin: @perspective;
196
+ }
197
+ .transform-origin(@origin) {
198
+ -webkit-transform-origin: @origin;
199
+ -moz-transform-origin: @origin;
200
+ -ms-transform-origin: @origin; // IE9 only
201
+ transform-origin: @origin;
202
+ }
203
+
204
+ // Animations
205
+ .animation(@animation) {
206
+ -webkit-animation: @animation;
207
+ animation: @animation;
208
+ }
209
+ .animation-name(@name) {
210
+ -webkit-animation-name: @name;
211
+ animation-name: @name;
212
+ }
213
+ .animation-duration(@duration) {
214
+ -webkit-animation-duration: @duration;
215
+ animation-duration: @duration;
216
+ }
217
+ .animation-timing-function(@timing-function) {
218
+ -webkit-animation-timing-function: @timing-function;
219
+ animation-timing-function: @timing-function;
220
+ }
221
+ .animation-delay(@delay) {
222
+ -webkit-animation-delay: @delay;
223
+ animation-delay: @delay;
224
+ }
225
+ .animation-iteration-count(@iteration-count) {
226
+ -webkit-animation-iteration-count: @iteration-count;
227
+ animation-iteration-count: @iteration-count;
228
+ }
229
+ .animation-direction(@direction) {
230
+ -webkit-animation-direction: @direction;
231
+ animation-direction: @direction;
232
+ }
233
+
234
+ // Backface visibility
235
+ // Prevent browsers from flickering when using CSS 3D transforms.
236
+ // Default value is `visible`, but can be changed to `hidden`
237
+ .backface-visibility(@visibility){
238
+ -webkit-backface-visibility: @visibility;
239
+ -moz-backface-visibility: @visibility;
240
+ backface-visibility: @visibility;
241
+ }
242
+
243
+ // Box sizing
244
+ .box-sizing(@boxmodel) {
245
+ -webkit-box-sizing: @boxmodel;
246
+ -moz-box-sizing: @boxmodel;
247
+ box-sizing: @boxmodel;
248
+ }
249
+
250
+ // User select
251
+ // For selecting text on the page
252
+ .user-select(@select) {
253
+ -webkit-user-select: @select;
254
+ -moz-user-select: @select;
255
+ -ms-user-select: @select; // IE10+
256
+ -o-user-select: @select;
257
+ user-select: @select;
258
+ }
259
+
260
+ // Resize anything
261
+ .resizable(@direction) {
262
+ resize: @direction; // Options: horizontal, vertical, both
263
+ overflow: auto; // Safari fix
264
+ }
265
+
266
+ // CSS3 Content Columns
267
+ .content-columns(@column-count; @column-gap: @grid-gutter-width) {
268
+ -webkit-column-count: @column-count;
269
+ -moz-column-count: @column-count;
270
+ column-count: @column-count;
271
+ -webkit-column-gap: @column-gap;
272
+ -moz-column-gap: @column-gap;
273
+ column-gap: @column-gap;
274
+ }
275
+
276
+ // Optional hyphenation
277
+ .hyphens(@mode: auto) {
278
+ word-wrap: break-word;
279
+ -webkit-hyphens: @mode;
280
+ -moz-hyphens: @mode;
281
+ -ms-hyphens: @mode; // IE10+
282
+ -o-hyphens: @mode;
283
+ hyphens: @mode;
284
+ }
285
+
286
+ // Opacity
287
+ .opacity(@opacity) {
288
+ opacity: @opacity;
289
+ // IE8 filter
290
+ @opacity-ie: (@opacity * 100);
291
+ filter: ~"alpha(opacity=@{opacity-ie})";
292
+ }
293
+
294
+
295
+
296
+ // GRADIENTS
297
+ // --------------------------------------------------
298
+
299
+ #gradient {
300
+
301
+ // Horizontal gradient, from left to right
302
+ //
303
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
304
+ // Color stops are not available in IE9 and below.
305
+ .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
306
+ background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1-6, Chrome 10+
307
+ background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
308
+ background-repeat: repeat-x;
309
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
310
+ }
311
+
312
+ // Vertical gradient, from top to bottom
313
+ //
314
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
315
+ // Color stops are not available in IE9 and below.
316
+ .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
317
+ background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+
318
+ background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
319
+ background-repeat: repeat-x;
320
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
321
+ }
322
+
323
+ .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
324
+ background-repeat: repeat-x;
325
+ background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+
326
+ background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
327
+ }
328
+ .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
329
+ background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
330
+ background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
331
+ background-repeat: no-repeat;
332
+ 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
333
+ }
334
+ .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
335
+ background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
336
+ background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
337
+ background-repeat: no-repeat;
338
+ 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
339
+ }
340
+ .radial(@inner-color: #555; @outer-color: #333) {
341
+ background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
342
+ background-image: radial-gradient(circle, @inner-color, @outer-color);
343
+ background-repeat: no-repeat;
344
+ }
345
+ .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {
346
+ background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
347
+ background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
348
+ }
349
+ }
350
+
351
+ // Reset filters for IE
352
+ //
353
+ // When you need to remove a gradient background, do not forget to use this to reset
354
+ // the IE filter for IE9 and below.
355
+ .reset-filter() {
356
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
357
+ }
358
+
359
+
360
+
361
+ // Retina images
362
+ //
363
+ // Short retina mixin for setting background-image and -size
364
+
365
+ .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
366
+ background-image: url("@{file-1x}");
367
+
368
+ @media
369
+ only screen and (-webkit-min-device-pixel-ratio: 2),
370
+ only screen and ( min--moz-device-pixel-ratio: 2),
371
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
372
+ only screen and ( min-device-pixel-ratio: 2),
373
+ only screen and ( min-resolution: 192dpi),
374
+ only screen and ( min-resolution: 2dppx) {
375
+ background-image: url("@{file-2x}");
376
+ background-size: @width-1x @height-1x;
377
+ }
378
+ }
379
+
380
+
381
+ // Responsive image
382
+ //
383
+ // Keep images from scaling beyond the width of their parents.
384
+
385
+ .img-responsive(@display: block) {
386
+ display: @display;
387
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
388
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
389
+ }
390
+
391
+
392
+ // COMPONENT MIXINS
393
+ // --------------------------------------------------
394
+
395
+ // Horizontal dividers
396
+ // -------------------------
397
+ // Dividers (basically an hr) within dropdowns and nav lists
398
+ .nav-divider(@color: #e5e5e5) {
399
+ height: 1px;
400
+ margin: ((@line-height-computed / 2) - 1) 0;
401
+ overflow: hidden;
402
+ background-color: @color;
403
+ }
404
+
405
+ // Panels
406
+ // -------------------------
407
+ .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {
408
+ border-color: @border;
409
+
410
+ & > .panel-heading {
411
+ color: @heading-text-color;
412
+ background-color: @heading-bg-color;
413
+ border-color: @heading-border;
414
+
415
+ + .panel-collapse .panel-body {
416
+ border-top-color: @border;
417
+ }
418
+ }
419
+ & > .panel-footer {
420
+ + .panel-collapse .panel-body {
421
+ border-bottom-color: @border;
422
+ }
423
+ }
424
+ }
425
+
426
+ // Alerts
427
+ // -------------------------
428
+ .alert-variant(@background; @border; @text-color) {
429
+ background-color: @background;
430
+ border-color: @border;
431
+ color: @text-color;
432
+
433
+ hr {
434
+ border-top-color: darken(@border, 5%);
435
+ }
436
+ .alert-link {
437
+ color: darken(@text-color, 10%);
438
+ }
439
+ }
440
+
441
+ // Tables
442
+ // -------------------------
443
+ .table-row-variant(@state; @background) {
444
+ // Exact selectors below required to override `.table-striped` and prevent
445
+ // inheritance to nested tables.
446
+ .table > thead > tr,
447
+ .table > tbody > tr,
448
+ .table > tfoot > tr {
449
+ > td.@{state},
450
+ > th.@{state},
451
+ &.@{state} > td,
452
+ &.@{state} > th {
453
+ background-color: @background;
454
+ }
455
+ }
456
+
457
+ // Hover states for `.table-hover`
458
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
459
+ .table-hover > tbody > tr {
460
+ > td.@{state}:hover,
461
+ > th.@{state}:hover,
462
+ &.@{state}:hover > td,
463
+ &.@{state}:hover > th {
464
+ background-color: darken(@background, 5%);
465
+ }
466
+ }
467
+ }
468
+
469
+ // List Groups
470
+ // -------------------------
471
+ .list-group-item-variant(@state; @background; @color) {
472
+ .list-group-item-@{state} {
473
+ color: @color;
474
+ background-color: @background;
475
+
476
+ a& {
477
+ color: @color;
478
+
479
+ .list-group-item-heading { color: inherit; }
480
+
481
+ &:hover,
482
+ &:focus {
483
+ color: @color;
484
+ background-color: darken(@background, 5%);
485
+ }
486
+ &.active,
487
+ &.active:hover,
488
+ &.active:focus {
489
+ color: #fff;
490
+ background-color: @color;
491
+ border-color: @color;
492
+ }
493
+ }
494
+ }
495
+ }
496
+
497
+ // Button variants
498
+ // -------------------------
499
+ // Easily pump out default styles, as well as :hover, :focus, :active,
500
+ // and disabled options for all buttons
501
+ .button-variant(@color; @background; @border) {
502
+ color: @color;
503
+ background-color: @background;
504
+ border-color: @border;
505
+
506
+ &:hover,
507
+ &:focus,
508
+ &:active,
509
+ &.active,
510
+ .open .dropdown-toggle& {
511
+ color: @color;
512
+ background-color: darken(@background, 8%);
513
+ border-color: darken(@border, 12%);
514
+ }
515
+ &:active,
516
+ &.active,
517
+ .open .dropdown-toggle& {
518
+ background-image: none;
519
+ }
520
+ &.disabled,
521
+ &[disabled],
522
+ fieldset[disabled] & {
523
+ &,
524
+ &:hover,
525
+ &:focus,
526
+ &:active,
527
+ &.active {
528
+ background-color: @background;
529
+ border-color: @border;
530
+ }
531
+ }
532
+
533
+ .badge {
534
+ color: @background;
535
+ background-color: @color;
536
+ }
537
+ }
538
+
539
+ // Button sizes
540
+ // -------------------------
541
+ .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
542
+ padding: @padding-vertical @padding-horizontal;
543
+ font-size: @font-size;
544
+ line-height: @line-height;
545
+ border-radius: @border-radius;
546
+ }
547
+
548
+ // Pagination
549
+ // -------------------------
550
+ .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
551
+ > li {
552
+ > a,
553
+ > span {
554
+ padding: @padding-vertical @padding-horizontal;
555
+ font-size: @font-size;
556
+ }
557
+ &:first-child {
558
+ > a,
559
+ > span {
560
+ .border-left-radius(@border-radius);
561
+ }
562
+ }
563
+ &:last-child {
564
+ > a,
565
+ > span {
566
+ .border-right-radius(@border-radius);
567
+ }
568
+ }
569
+ }
570
+ }
571
+
572
+ // Labels
573
+ // -------------------------
574
+ .label-variant(@color) {
575
+ background-color: @color;
576
+ &[href] {
577
+ &:hover,
578
+ &:focus {
579
+ background-color: darken(@color, 10%);
580
+ }
581
+ }
582
+ }
583
+
584
+ // Contextual backgrounds
585
+ // -------------------------
586
+ .bg-variant(@color) {
587
+ background-color: @color;
588
+ a&:hover {
589
+ background-color: darken(@color, 10%);
590
+ }
591
+ }
592
+
593
+ // Typography
594
+ // -------------------------
595
+ .text-emphasis-variant(@color) {
596
+ color: @color;
597
+ a&:hover {
598
+ color: darken(@color, 10%);
599
+ }
600
+ }
601
+
602
+ // Navbar vertical align
603
+ // -------------------------
604
+ // Vertically center elements in the navbar.
605
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
606
+ .navbar-vertical-align(@element-height) {
607
+ margin-top: ((@navbar-height - @element-height) / 2);
608
+ margin-bottom: ((@navbar-height - @element-height) / 2);
609
+ }
610
+
611
+ // Progress bars
612
+ // -------------------------
613
+ .progress-bar-variant(@color) {
614
+ background-color: @color;
615
+ .progress-striped & {
616
+ #gradient > .striped();
617
+ }
618
+ }
619
+
620
+ // Responsive utilities
621
+ // -------------------------
622
+ // More easily include all the states for responsive-utilities.less.
623
+ .responsive-visibility() {
624
+ display: block !important;
625
+ table& { display: table; }
626
+ tr& { display: table-row !important; }
627
+ th&,
628
+ td& { display: table-cell !important; }
629
+ }
630
+
631
+ .responsive-invisibility() {
632
+ &,
633
+ tr&,
634
+ th&,
635
+ td& { display: none !important; }
636
+ }
637
+
638
+
639
+ // Grid System
640
+ // -----------
641
+
642
+ // Centered container element
643
+ .container-fixed() {
644
+ margin-right: auto;
645
+ margin-left: auto;
646
+ padding-left: (@grid-gutter-width / 2);
647
+ padding-right: (@grid-gutter-width / 2);
648
+ &:extend(.clearfix all);
649
+ }
650
+
651
+ // Creates a wrapper for a series of columns
652
+ .make-row(@gutter: @grid-gutter-width) {
653
+ margin-left: (@gutter / -2);
654
+ margin-right: (@gutter / -2);
655
+ &:extend(.clearfix all);
656
+ }
657
+
658
+ // Generate the extra small columns
659
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
660
+ position: relative;
661
+ float: left;
662
+ width: percentage((@columns / @grid-columns));
663
+ min-height: 1px;
664
+ padding-left: (@gutter / 2);
665
+ padding-right: (@gutter / 2);
666
+ }
667
+ .make-xs-column-offset(@columns) {
668
+ @media (min-width: @screen-xs-min) {
669
+ margin-left: percentage((@columns / @grid-columns));
670
+ }
671
+ }
672
+ .make-xs-column-push(@columns) {
673
+ @media (min-width: @screen-xs-min) {
674
+ left: percentage((@columns / @grid-columns));
675
+ }
676
+ }
677
+ .make-xs-column-pull(@columns) {
678
+ @media (min-width: @screen-xs-min) {
679
+ right: percentage((@columns / @grid-columns));
680
+ }
681
+ }
682
+
683
+
684
+ // Generate the small columns
685
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
686
+ position: relative;
687
+ min-height: 1px;
688
+ padding-left: (@gutter / 2);
689
+ padding-right: (@gutter / 2);
690
+
691
+ @media (min-width: @screen-sm-min) {
692
+ float: left;
693
+ width: percentage((@columns / @grid-columns));
694
+ }
695
+ }
696
+ .make-sm-column-offset(@columns) {
697
+ @media (min-width: @screen-sm-min) {
698
+ margin-left: percentage((@columns / @grid-columns));
699
+ }
700
+ }
701
+ .make-sm-column-push(@columns) {
702
+ @media (min-width: @screen-sm-min) {
703
+ left: percentage((@columns / @grid-columns));
704
+ }
705
+ }
706
+ .make-sm-column-pull(@columns) {
707
+ @media (min-width: @screen-sm-min) {
708
+ right: percentage((@columns / @grid-columns));
709
+ }
710
+ }
711
+
712
+
713
+ // Generate the medium columns
714
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
715
+ position: relative;
716
+ min-height: 1px;
717
+ padding-left: (@gutter / 2);
718
+ padding-right: (@gutter / 2);
719
+
720
+ @media (min-width: @screen-md-min) {
721
+ float: left;
722
+ width: percentage((@columns / @grid-columns));
723
+ }
724
+ }
725
+ .make-md-column-offset(@columns) {
726
+ @media (min-width: @screen-md-min) {
727
+ margin-left: percentage((@columns / @grid-columns));
728
+ }
729
+ }
730
+ .make-md-column-push(@columns) {
731
+ @media (min-width: @screen-md-min) {
732
+ left: percentage((@columns / @grid-columns));
733
+ }
734
+ }
735
+ .make-md-column-pull(@columns) {
736
+ @media (min-width: @screen-md-min) {
737
+ right: percentage((@columns / @grid-columns));
738
+ }
739
+ }
740
+
741
+
742
+ // Generate the large columns
743
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
744
+ position: relative;
745
+ min-height: 1px;
746
+ padding-left: (@gutter / 2);
747
+ padding-right: (@gutter / 2);
748
+
749
+ @media (min-width: @screen-lg-min) {
750
+ float: left;
751
+ width: percentage((@columns / @grid-columns));
752
+ }
753
+ }
754
+ .make-lg-column-offset(@columns) {
755
+ @media (min-width: @screen-lg-min) {
756
+ margin-left: percentage((@columns / @grid-columns));
757
+ }
758
+ }
759
+ .make-lg-column-push(@columns) {
760
+ @media (min-width: @screen-lg-min) {
761
+ left: percentage((@columns / @grid-columns));
762
+ }
763
+ }
764
+ .make-lg-column-pull(@columns) {
765
+ @media (min-width: @screen-lg-min) {
766
+ right: percentage((@columns / @grid-columns));
767
+ }
768
+ }
769
+
770
+
771
+ // Framework grid generation
772
+ //
773
+ // Used only by Bootstrap to generate the correct number of grid classes given
774
+ // any value of `@grid-columns`.
775
+
776
+ .make-grid-columns() {
777
+ // Common styles for all sizes of grid columns, widths 1-12
778
+ .col(@index) when (@index = 1) { // initial
779
+ @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
780
+ .col((@index + 1), @item);
781
+ }
782
+ .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
783
+ @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
784
+ .col((@index + 1), ~"@{list}, @{item}");
785
+ }
786
+ .col(@index, @list) when (@index > @grid-columns) { // terminal
787
+ @{list} {
788
+ position: relative;
789
+ // Prevent columns from collapsing when empty
790
+ min-height: 1px;
791
+ // Inner gutter via padding
792
+ padding-left: (@grid-gutter-width / 2);
793
+ padding-right: (@grid-gutter-width / 2);
794
+ }
795
+ }
796
+ .col(1); // kickstart it
797
+ }
798
+
799
+ .make-grid-columns-float(@class) {
800
+ .col(@index) when (@index = 1) { // initial
801
+ @item: ~".col-@{class}-@{index}";
802
+ .col((@index + 1), @item);
803
+ }
804
+ .col(@index, @list) when (@index =< @grid-columns) { // general
805
+ @item: ~".col-@{class}-@{index}";
806
+ .col((@index + 1), ~"@{list}, @{item}");
807
+ }
808
+ .col(@index, @list) when (@index > @grid-columns) { // terminal
809
+ @{list} {
810
+ float: left;
811
+ }
812
+ }
813
+ .col(1); // kickstart it
814
+ }
815
+
816
+ .calc-grid(@index, @class, @type) when (@type = width) and (@index > 0) {
817
+ .col-@{class}-@{index} {
818
+ width: percentage((@index / @grid-columns));
819
+ }
820
+ }
821
+ .calc-grid(@index, @class, @type) when (@type = push) {
822
+ .col-@{class}-push-@{index} {
823
+ left: percentage((@index / @grid-columns));
824
+ }
825
+ }
826
+ .calc-grid(@index, @class, @type) when (@type = pull) {
827
+ .col-@{class}-pull-@{index} {
828
+ right: percentage((@index / @grid-columns));
829
+ }
830
+ }
831
+ .calc-grid(@index, @class, @type) when (@type = offset) {
832
+ .col-@{class}-offset-@{index} {
833
+ margin-left: percentage((@index / @grid-columns));
834
+ }
835
+ }
836
+
837
+ // Basic looping in LESS
838
+ .make-grid(@index, @class, @type) when (@index >= 0) {
839
+ .calc-grid(@index, @class, @type);
840
+ // next iteration
841
+ .make-grid((@index - 1), @class, @type);
842
+ }
843
+
844
+
845
+ // Form validation states
846
+ //
847
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
848
+ // and successes.
849
+
850
+ .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
851
+ // Color the label and help text
852
+ .help-block,
853
+ .control-label,
854
+ .radio,
855
+ .checkbox,
856
+ .radio-inline,
857
+ .checkbox-inline {
858
+ color: @text-color;
859
+ }
860
+ // Set the border and box shadow on specific inputs to match
861
+ .form-control {
862
+ border-color: @border-color;
863
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
864
+ &:focus {
865
+ border-color: darken(@border-color, 10%);
866
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
867
+ .box-shadow(@shadow);
868
+ }
869
+ }
870
+ // Set validation states also for addons
871
+ .input-group-addon {
872
+ color: @text-color;
873
+ border-color: @border-color;
874
+ background-color: @background-color;
875
+ }
876
+ // Optional feedback icon
877
+ .form-control-feedback {
878
+ color: @text-color;
879
+ }
880
+ }
881
+
882
+ // Form control focus state
883
+ //
884
+ // Generate a customized focus state and for any input with the specified color,
885
+ // which defaults to the `@input-focus-border` variable.
886
+ //
887
+ // We highly encourage you to not customize the default value, but instead use
888
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
889
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
890
+ // usability and accessibility should be taken into account with any change.
891
+ //
892
+ // Example usage: change the default blue border and shadow to white for better
893
+ // contrast against a dark gray background.
894
+
895
+ .form-control-focus(@color: @input-border-focus) {
896
+ @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
897
+ &:focus {
898
+ border-color: @color;
899
+ outline: 0;
900
+ .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
901
+ }
902
+ }
903
+
904
+ // Form control sizing
905
+ //
906
+ // Relative text size, padding, and border-radii changes for form controls. For
907
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
908
+ // element gets special love because it's special, and that's a fact!
909
+
910
+ .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
911
+ height: @input-height;
912
+ padding: @padding-vertical @padding-horizontal;
913
+ font-size: @font-size;
914
+ line-height: @line-height;
915
+ border-radius: @border-radius;
916
+
917
+ select& {
918
+ height: @input-height;
919
+ line-height: @input-height;
920
+ }
921
+
922
+ textarea&,
923
+ select[multiple]& {
924
+ height: auto;
925
+ }
926
+ }