rvnstat 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. checksums.yaml +7 -0
  2. data/._README.md +0 -0
  3. data/._ss.png +0 -0
  4. data/.gitignore +17 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +34 -0
  8. data/Rakefile +1 -0
  9. data/bin/._rvnstat +0 -0
  10. data/bin/rvnstat +9 -0
  11. data/config.ru +4 -0
  12. data/config.yml +3 -0
  13. data/lib/._app.rb +0 -0
  14. data/lib/._config.rb +0 -0
  15. data/lib/._require.rb +0 -0
  16. data/lib/._rvnstat.rb +0 -0
  17. data/lib/._vnstat.rb +0 -0
  18. data/lib/app.rb +102 -0
  19. data/lib/config.rb +13 -0
  20. data/lib/require.rb +10 -0
  21. data/lib/rvnstat.rb +5 -0
  22. data/lib/rvnstat/._version.rb +0 -0
  23. data/lib/rvnstat/version.rb +3 -0
  24. data/lib/vnstat.rb +74 -0
  25. data/public/CNAME +1 -0
  26. data/public/CONTRIBUTING.md +192 -0
  27. data/public/Gruntfile.js +418 -0
  28. data/public/LICENSE +21 -0
  29. data/public/README.md +173 -0
  30. data/public/_config.yml +35 -0
  31. data/public/bower.json +24 -0
  32. data/public/browserstack.json +44 -0
  33. data/public/composer.json +25 -0
  34. data/public/dist/css/._custom.css +0 -0
  35. data/public/dist/css/bootstrap-theme.css +347 -0
  36. data/public/dist/css/bootstrap-theme.css.map +1 -0
  37. data/public/dist/css/bootstrap-theme.min.css +7 -0
  38. data/public/dist/css/bootstrap.css +5831 -0
  39. data/public/dist/css/bootstrap.css.map +1 -0
  40. data/public/dist/css/bootstrap.min.css +7 -0
  41. data/public/dist/css/custom.css +20 -0
  42. data/public/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  43. data/public/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  44. data/public/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  45. data/public/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  46. data/public/dist/js/bootstrap.js +1951 -0
  47. data/public/dist/js/bootstrap.min.js +6 -0
  48. data/public/docs/LICENSE +319 -0
  49. data/public/docs/_data/glyphicons.yml +203 -0
  50. data/public/docs/_data/showcase.yml +19 -0
  51. data/public/docs/_includes/ads.html +1 -0
  52. data/public/docs/_includes/customizer-variables.html +1690 -0
  53. data/public/docs/_includes/footer.html +70 -0
  54. data/public/docs/_includes/header.html +42 -0
  55. data/public/docs/_includes/nav-about.html +9 -0
  56. data/public/docs/_includes/nav-components.html +138 -0
  57. data/public/docs/_includes/nav-css.html +127 -0
  58. data/public/docs/_includes/nav-customize.html +46 -0
  59. data/public/docs/_includes/nav-getting-started.html +62 -0
  60. data/public/docs/_includes/nav-javascript.html +89 -0
  61. data/public/docs/_includes/nav-main.html +36 -0
  62. data/public/docs/_includes/nav-migration.html +12 -0
  63. data/public/docs/_includes/social-buttons.html +16 -0
  64. data/public/docs/_layouts/default.html +55 -0
  65. data/public/docs/_layouts/home.html +18 -0
  66. data/public/docs/about.html +149 -0
  67. data/public/docs/assets/css/docs.css +1394 -0
  68. data/public/docs/assets/css/docs.min.css +6 -0
  69. data/public/docs/assets/css/pygments-manni.css +66 -0
  70. data/public/docs/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
  71. data/public/docs/assets/ico/favicon.ico +0 -0
  72. data/public/docs/assets/img/components.png +0 -0
  73. data/public/docs/assets/img/devices.png +0 -0
  74. data/public/docs/assets/img/sass-less.png +0 -0
  75. data/public/docs/assets/js/application.js +101 -0
  76. data/public/docs/assets/js/customize.min.js +49 -0
  77. data/public/docs/assets/js/customizer.js +348 -0
  78. data/public/docs/assets/js/docs.min.js +16 -0
  79. data/public/docs/assets/js/ie8-responsive-file-warning.js +12 -0
  80. data/public/docs/assets/js/raw-files.min.js +8 -0
  81. data/public/docs/assets/js/vendor/blob.js +166 -0
  82. data/public/docs/assets/js/vendor/filesaver.js +236 -0
  83. data/public/docs/assets/js/vendor/holder.js +645 -0
  84. data/public/docs/assets/js/vendor/jszip.js +1474 -0
  85. data/public/docs/assets/js/vendor/less.min.js +16 -0
  86. data/public/docs/assets/js/vendor/uglify.min.js +14 -0
  87. data/public/docs/components.html +3001 -0
  88. data/public/docs/css.html +3346 -0
  89. data/public/docs/customize.html +356 -0
  90. data/public/docs/customizer-nav.jade +15 -0
  91. data/public/docs/customizer-variables.jade +21 -0
  92. data/public/docs/dist/css/bootstrap-theme.css.map +1 -0
  93. data/public/docs/dist/css/bootstrap-theme.min.css +7 -0
  94. data/public/docs/dist/css/bootstrap.css.map +1 -0
  95. data/public/docs/dist/css/bootstrap.min.css +7 -0
  96. data/public/docs/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  97. data/public/docs/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  98. data/public/docs/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  99. data/public/docs/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  100. data/public/docs/dist/js/bootstrap.min.js +7 -0
  101. data/public/docs/examples/blog/blog.css +168 -0
  102. data/public/docs/examples/blog/index.html +171 -0
  103. data/public/docs/examples/carousel/carousel.css +148 -0
  104. data/public/docs/examples/carousel/index.html +206 -0
  105. data/public/docs/examples/cover/cover.css +161 -0
  106. data/public/docs/examples/cover/index.html +75 -0
  107. data/public/docs/examples/dashboard/dashboard.css +93 -0
  108. data/public/docs/examples/dashboard/index.html +243 -0
  109. data/public/docs/examples/grid/grid.css +28 -0
  110. data/public/docs/examples/grid/index.html +152 -0
  111. data/public/docs/examples/jumbotron-narrow/index.html +82 -0
  112. data/public/docs/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
  113. data/public/docs/examples/jumbotron/index.html +99 -0
  114. data/public/docs/examples/jumbotron/jumbotron.css +5 -0
  115. data/public/docs/examples/justified-nav/index.html +84 -0
  116. data/public/docs/examples/justified-nav/justified-nav.css +88 -0
  117. data/public/docs/examples/navbar-fixed-top/index.html +91 -0
  118. data/public/docs/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
  119. data/public/docs/examples/navbar-static-top/index.html +92 -0
  120. data/public/docs/examples/navbar-static-top/navbar-static-top.css +7 -0
  121. data/public/docs/examples/navbar/index.html +90 -0
  122. data/public/docs/examples/navbar/navbar.css +8 -0
  123. data/public/docs/examples/non-responsive/index.html +105 -0
  124. data/public/docs/examples/non-responsive/non-responsive.css +120 -0
  125. data/public/docs/examples/offcanvas/index.html +130 -0
  126. data/public/docs/examples/offcanvas/offcanvas.css +51 -0
  127. data/public/docs/examples/offcanvas/offcanvas.js +5 -0
  128. data/public/docs/examples/screenshots/blog.jpg +0 -0
  129. data/public/docs/examples/screenshots/carousel.jpg +0 -0
  130. data/public/docs/examples/screenshots/cover.jpg +0 -0
  131. data/public/docs/examples/screenshots/dashboard.jpg +0 -0
  132. data/public/docs/examples/screenshots/grid.jpg +0 -0
  133. data/public/docs/examples/screenshots/jumbotron-narrow.jpg +0 -0
  134. data/public/docs/examples/screenshots/jumbotron.jpg +0 -0
  135. data/public/docs/examples/screenshots/justified-nav.jpg +0 -0
  136. data/public/docs/examples/screenshots/navbar-fixed.jpg +0 -0
  137. data/public/docs/examples/screenshots/navbar-static.jpg +0 -0
  138. data/public/docs/examples/screenshots/navbar.jpg +0 -0
  139. data/public/docs/examples/screenshots/non-responsive.jpg +0 -0
  140. data/public/docs/examples/screenshots/offcanvas.jpg +0 -0
  141. data/public/docs/examples/screenshots/sign-in.jpg +0 -0
  142. data/public/docs/examples/screenshots/starter-template.jpg +0 -0
  143. data/public/docs/examples/screenshots/sticky-footer-navbar.jpg +0 -0
  144. data/public/docs/examples/screenshots/sticky-footer.jpg +0 -0
  145. data/public/docs/examples/screenshots/theme.jpg +0 -0
  146. data/public/docs/examples/signin/index.html +50 -0
  147. data/public/docs/examples/signin/signin.css +40 -0
  148. data/public/docs/examples/starter-template/index.html +68 -0
  149. data/public/docs/examples/starter-template/starter-template.css +7 -0
  150. data/public/docs/examples/sticky-footer-navbar/index.html +91 -0
  151. data/public/docs/examples/sticky-footer-navbar/sticky-footer-navbar.css +45 -0
  152. data/public/docs/examples/sticky-footer/index.html +55 -0
  153. data/public/docs/examples/sticky-footer/sticky-footer.css +38 -0
  154. data/public/docs/examples/theme/index.html +384 -0
  155. data/public/docs/examples/theme/theme.css +14 -0
  156. data/public/docs/getting-started.html +773 -0
  157. data/public/docs/grunt/bs-glyphicons-data-generator.js +33 -0
  158. data/public/docs/grunt/bs-lessdoc-parser.js +236 -0
  159. data/public/docs/grunt/bs-raw-files-generator.js +31 -0
  160. data/public/docs/index.html +72 -0
  161. data/public/docs/javascript.html +2141 -0
  162. data/public/docs/migration.html +423 -0
  163. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  164. data/public/fonts/glyphicons-halflings-regular.svg +229 -0
  165. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  166. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  167. data/public/js/._exporting.js +0 -0
  168. data/public/js/._highcharts-all.js +0 -0
  169. data/public/js/._jquery-min.js +0 -0
  170. data/public/js/.jscs.json +15 -0
  171. data/public/js/.jshintrc +14 -0
  172. data/public/js/affix.js +137 -0
  173. data/public/js/alert.js +88 -0
  174. data/public/js/bootstrap.min.js +6 -0
  175. data/public/js/button.js +107 -0
  176. data/public/js/carousel.js +205 -0
  177. data/public/js/collapse.js +170 -0
  178. data/public/js/dropdown.js +147 -0
  179. data/public/js/highcharts.js +294 -0
  180. data/public/js/jquery-1.11.0.min.js +4 -0
  181. data/public/js/modal.js +243 -0
  182. data/public/js/popover.js +110 -0
  183. data/public/js/scrollspy.js +153 -0
  184. data/public/js/tab.js +125 -0
  185. data/public/js/tests/index.html +54 -0
  186. data/public/js/tests/unit/affix.js +50 -0
  187. data/public/js/tests/unit/alert.js +62 -0
  188. data/public/js/tests/unit/button.js +122 -0
  189. data/public/js/tests/unit/carousel.js +110 -0
  190. data/public/js/tests/unit/collapse.js +164 -0
  191. data/public/js/tests/unit/dropdown.js +218 -0
  192. data/public/js/tests/unit/modal.js +195 -0
  193. data/public/js/tests/unit/phantom.js +69 -0
  194. data/public/js/tests/unit/popover.js +133 -0
  195. data/public/js/tests/unit/scrollspy.js +36 -0
  196. data/public/js/tests/unit/tab.js +86 -0
  197. data/public/js/tests/unit/tooltip.js +432 -0
  198. data/public/js/tests/vendor/jquery.js +6 -0
  199. data/public/js/tests/vendor/qunit.css +245 -0
  200. data/public/js/tests/vendor/qunit.js +2210 -0
  201. data/public/js/tooltip.js +399 -0
  202. data/public/js/transition.js +48 -0
  203. data/public/less/.csscomb.json +297 -0
  204. data/public/less/.csslintrc +19 -0
  205. data/public/less/alerts.less +67 -0
  206. data/public/less/badges.less +55 -0
  207. data/public/less/bootstrap.less +49 -0
  208. data/public/less/breadcrumbs.less +26 -0
  209. data/public/less/button-groups.less +226 -0
  210. data/public/less/buttons.less +155 -0
  211. data/public/less/carousel.less +232 -0
  212. data/public/less/close.less +33 -0
  213. data/public/less/code.less +63 -0
  214. data/public/less/component-animations.less +29 -0
  215. data/public/less/dropdowns.less +213 -0
  216. data/public/less/forms.less +419 -0
  217. data/public/less/glyphicons.less +233 -0
  218. data/public/less/grid.less +100 -0
  219. data/public/less/input-groups.less +157 -0
  220. data/public/less/jumbotron.less +44 -0
  221. data/public/less/labels.less +64 -0
  222. data/public/less/list-group.less +110 -0
  223. data/public/less/media.less +56 -0
  224. data/public/less/mixins.less +926 -0
  225. data/public/less/modals.less +138 -0
  226. data/public/less/navbar.less +616 -0
  227. data/public/less/navs.less +242 -0
  228. data/public/less/normalize.less +423 -0
  229. data/public/less/pager.less +55 -0
  230. data/public/less/pagination.less +88 -0
  231. data/public/less/panels.less +230 -0
  232. data/public/less/popovers.less +133 -0
  233. data/public/less/print.less +101 -0
  234. data/public/less/progress-bars.less +80 -0
  235. data/public/less/responsive-utilities.less +93 -0
  236. data/public/less/scaffolding.less +134 -0
  237. data/public/less/tables.less +233 -0
  238. data/public/less/theme.less +247 -0
  239. data/public/less/thumbnails.less +36 -0
  240. data/public/less/tooltip.less +95 -0
  241. data/public/less/type.less +296 -0
  242. data/public/less/utilities.less +56 -0
  243. data/public/less/variables.less +827 -0
  244. data/public/less/wells.less +29 -0
  245. data/public/package.json +71 -0
  246. data/public/test-infra/README.md +100 -0
  247. data/public/test-infra/npm-shrinkwrap.canonical.json +1 -0
  248. data/public/test-infra/requirements.txt +1 -0
  249. data/public/test-infra/s3_cache.py +107 -0
  250. data/public/test-infra/sauce_browsers.yml +83 -0
  251. data/public/test-infra/shrinkwrap.js +24 -0
  252. data/public/test-infra/uncached-npm-install.sh +4 -0
  253. data/rvnstat.gemspec +26 -0
  254. data/rvnstat.yml +3 -0
  255. data/ss.png +0 -0
  256. data/untitled.txt +0 -0
  257. data/views/._hourly.erb +0 -0
  258. data/views/._index.erb +0 -0
  259. data/views/._live_traffic.erb +0 -0
  260. data/views/._monthly.erb +0 -0
  261. data/views/._top_ten.erb +0 -0
  262. data/views/day_detail.erb +44 -0
  263. data/views/day_total.erb +42 -0
  264. data/views/graph_test.erb +2 -0
  265. data/views/hourly.erb +19 -0
  266. data/views/index.erb +71 -0
  267. data/views/layout.erb +28 -0
  268. data/views/live_traffic.erb +57 -0
  269. data/views/monthly.erb +21 -0
  270. data/views/top_ten.erb +21 -0
  271. metadata +385 -0
@@ -0,0 +1,44 @@
1
+ //
2
+ // Jumbotron
3
+ // --------------------------------------------------
4
+
5
+
6
+ .jumbotron {
7
+ padding: @jumbotron-padding;
8
+ margin-bottom: @jumbotron-padding;
9
+ color: @jumbotron-color;
10
+ background-color: @jumbotron-bg;
11
+
12
+ h1,
13
+ .h1 {
14
+ color: @jumbotron-heading-color;
15
+ }
16
+ p {
17
+ margin-bottom: (@jumbotron-padding / 2);
18
+ font-size: @jumbotron-font-size;
19
+ font-weight: 200;
20
+ }
21
+
22
+ .container & {
23
+ border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container
24
+ }
25
+
26
+ .container {
27
+ max-width: 100%;
28
+ }
29
+
30
+ @media screen and (min-width: @screen-sm-min) {
31
+ padding-top: (@jumbotron-padding * 1.6);
32
+ padding-bottom: (@jumbotron-padding * 1.6);
33
+
34
+ .container & {
35
+ padding-left: (@jumbotron-padding * 2);
36
+ padding-right: (@jumbotron-padding * 2);
37
+ }
38
+
39
+ h1,
40
+ .h1 {
41
+ font-size: (@font-size-base * 4.5);
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,64 @@
1
+ //
2
+ // Labels
3
+ // --------------------------------------------------
4
+
5
+ .label {
6
+ display: inline;
7
+ padding: .2em .6em .3em;
8
+ font-size: 75%;
9
+ font-weight: bold;
10
+ line-height: 1;
11
+ color: @label-color;
12
+ text-align: center;
13
+ white-space: nowrap;
14
+ vertical-align: baseline;
15
+ border-radius: .25em;
16
+
17
+ // Add hover effects, but only for links
18
+ &[href] {
19
+ &:hover,
20
+ &:focus {
21
+ color: @label-link-hover-color;
22
+ text-decoration: none;
23
+ cursor: pointer;
24
+ }
25
+ }
26
+
27
+ // Empty labels collapse automatically (not available in IE8)
28
+ &:empty {
29
+ display: none;
30
+ }
31
+
32
+ // Quick fix for labels in buttons
33
+ .btn & {
34
+ position: relative;
35
+ top: -1px;
36
+ }
37
+ }
38
+
39
+ // Colors
40
+ // Contextual variations (linked labels get darker on :hover)
41
+
42
+ .label-default {
43
+ .label-variant(@label-default-bg);
44
+ }
45
+
46
+ .label-primary {
47
+ .label-variant(@label-primary-bg);
48
+ }
49
+
50
+ .label-success {
51
+ .label-variant(@label-success-bg);
52
+ }
53
+
54
+ .label-info {
55
+ .label-variant(@label-info-bg);
56
+ }
57
+
58
+ .label-warning {
59
+ .label-variant(@label-warning-bg);
60
+ }
61
+
62
+ .label-danger {
63
+ .label-variant(@label-danger-bg);
64
+ }
@@ -0,0 +1,110 @@
1
+ //
2
+ // List groups
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base class
7
+ //
8
+ // Easily usable on <ul>, <ol>, or <div>.
9
+
10
+ .list-group {
11
+ // No need to set list-style: none; since .list-group-item is block level
12
+ margin-bottom: 20px;
13
+ padding-left: 0; // reset padding because ul and ol
14
+ }
15
+
16
+
17
+ // Individual list items
18
+ //
19
+ // Use on `li`s or `div`s within the `.list-group` parent.
20
+
21
+ .list-group-item {
22
+ position: relative;
23
+ display: block;
24
+ padding: 10px 15px;
25
+ // Place the border on the list items and negative margin up for better styling
26
+ margin-bottom: -1px;
27
+ background-color: @list-group-bg;
28
+ border: 1px solid @list-group-border;
29
+
30
+ // Round the first and last items
31
+ &:first-child {
32
+ .border-top-radius(@list-group-border-radius);
33
+ }
34
+ &:last-child {
35
+ margin-bottom: 0;
36
+ .border-bottom-radius(@list-group-border-radius);
37
+ }
38
+
39
+ // Align badges within list items
40
+ > .badge {
41
+ float: right;
42
+ }
43
+ > .badge + .badge {
44
+ margin-right: 5px;
45
+ }
46
+ }
47
+
48
+
49
+ // Linked list items
50
+ //
51
+ // Use anchor elements instead of `li`s or `div`s to create linked list items.
52
+ // Includes an extra `.active` modifier class for showing selected items.
53
+
54
+ a.list-group-item {
55
+ color: @list-group-link-color;
56
+
57
+ .list-group-item-heading {
58
+ color: @list-group-link-heading-color;
59
+ }
60
+
61
+ // Hover state
62
+ &:hover,
63
+ &:focus {
64
+ text-decoration: none;
65
+ background-color: @list-group-hover-bg;
66
+ }
67
+
68
+ // Active class on item itself, not parent
69
+ &.active,
70
+ &.active:hover,
71
+ &.active:focus {
72
+ z-index: 2; // Place active items above their siblings for proper border styling
73
+ color: @list-group-active-color;
74
+ background-color: @list-group-active-bg;
75
+ border-color: @list-group-active-border;
76
+
77
+ // Force color to inherit for custom content
78
+ .list-group-item-heading {
79
+ color: inherit;
80
+ }
81
+ .list-group-item-text {
82
+ color: @list-group-active-text-color;
83
+ }
84
+ }
85
+ }
86
+
87
+
88
+ // Contextual variants
89
+ //
90
+ // Add modifier classes to change text and background color on individual items.
91
+ // Organizationally, this must come after the `:hover` states.
92
+
93
+ .list-group-item-variant(success; @state-success-bg; @state-success-text);
94
+ .list-group-item-variant(info; @state-info-bg; @state-info-text);
95
+ .list-group-item-variant(warning; @state-warning-bg; @state-warning-text);
96
+ .list-group-item-variant(danger; @state-danger-bg; @state-danger-text);
97
+
98
+
99
+ // Custom content options
100
+ //
101
+ // Extra classes for creating well-formatted content within `.list-group-item`s.
102
+
103
+ .list-group-item-heading {
104
+ margin-top: 0;
105
+ margin-bottom: 5px;
106
+ }
107
+ .list-group-item-text {
108
+ margin-bottom: 0;
109
+ line-height: 1.3;
110
+ }
@@ -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
+ }