bootstrap-on-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/README.md +34 -0
  4. data/Rakefile +1 -0
  5. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  6. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +228 -0
  7. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  8. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  9. data/app/assets/javascripts/bootstrap/affix.js +126 -0
  10. data/app/assets/javascripts/bootstrap/alert.js +98 -0
  11. data/app/assets/javascripts/bootstrap/button.js +109 -0
  12. data/app/assets/javascripts/bootstrap/carousel.js +217 -0
  13. data/app/assets/javascripts/bootstrap/collapse.js +179 -0
  14. data/app/assets/javascripts/bootstrap/dropdown.js +154 -0
  15. data/app/assets/javascripts/bootstrap/modal.js +246 -0
  16. data/app/assets/javascripts/bootstrap/popover.js +117 -0
  17. data/app/assets/javascripts/bootstrap/scrollspy.js +158 -0
  18. data/app/assets/javascripts/bootstrap/tab.js +135 -0
  19. data/app/assets/javascripts/bootstrap/tooltip.js +386 -0
  20. data/app/assets/javascripts/bootstrap/transition.js +56 -0
  21. data/app/assets/stylesheets/bootstrap/alerts.less +67 -0
  22. data/app/assets/stylesheets/bootstrap/badges.less +51 -0
  23. data/app/assets/stylesheets/bootstrap/bootstrap.less +58 -0
  24. data/app/assets/stylesheets/bootstrap/breadcrumbs.less +23 -0
  25. data/app/assets/stylesheets/bootstrap/button-groups.less +248 -0
  26. data/app/assets/stylesheets/bootstrap/buttons.less +160 -0
  27. data/app/assets/stylesheets/bootstrap/carousel.less +209 -0
  28. data/app/assets/stylesheets/bootstrap/close.less +33 -0
  29. data/app/assets/stylesheets/bootstrap/code.less +56 -0
  30. data/app/assets/stylesheets/bootstrap/component-animations.less +29 -0
  31. data/app/assets/stylesheets/bootstrap/dropdowns.less +193 -0
  32. data/app/assets/stylesheets/bootstrap/forms.less +362 -0
  33. data/app/assets/stylesheets/bootstrap/glyphicons.less +236 -0
  34. data/app/assets/stylesheets/bootstrap/grid.less +346 -0
  35. data/app/assets/stylesheets/bootstrap/input-groups.less +127 -0
  36. data/app/assets/stylesheets/bootstrap/jumbotron.less +40 -0
  37. data/app/assets/stylesheets/bootstrap/labels.less +58 -0
  38. data/app/assets/stylesheets/bootstrap/list-group.less +88 -0
  39. data/app/assets/stylesheets/bootstrap/media.less +56 -0
  40. data/app/assets/stylesheets/bootstrap/mixins.less +744 -0
  41. data/app/assets/stylesheets/bootstrap/modals.less +141 -0
  42. data/app/assets/stylesheets/bootstrap/navbar.less +621 -0
  43. data/app/assets/stylesheets/bootstrap/navs.less +229 -0
  44. data/app/assets/stylesheets/bootstrap/normalize.less +396 -0
  45. data/app/assets/stylesheets/bootstrap/pager.less +55 -0
  46. data/app/assets/stylesheets/bootstrap/pagination.less +85 -0
  47. data/app/assets/stylesheets/bootstrap/panels.less +148 -0
  48. data/app/assets/stylesheets/bootstrap/popovers.less +133 -0
  49. data/app/assets/stylesheets/bootstrap/print.less +100 -0
  50. data/app/assets/stylesheets/bootstrap/progress-bars.less +95 -0
  51. data/app/assets/stylesheets/bootstrap/responsive-utilities.less +220 -0
  52. data/app/assets/stylesheets/bootstrap/scaffolding.less +130 -0
  53. data/app/assets/stylesheets/bootstrap/tables.less +238 -0
  54. data/app/assets/stylesheets/bootstrap/theme.less +241 -0
  55. data/app/assets/stylesheets/bootstrap/thumbnails.less +31 -0
  56. data/app/assets/stylesheets/bootstrap/tooltip.less +95 -0
  57. data/app/assets/stylesheets/bootstrap/type.less +242 -0
  58. data/app/assets/stylesheets/bootstrap/utilities.less +42 -0
  59. data/app/assets/stylesheets/bootstrap/variables.less +635 -0
  60. data/app/assets/stylesheets/bootstrap/wells.less +29 -0
  61. data/bootstrap-on-rails.gemspec +25 -0
  62. data/lib/bootstrap-on-rails.rb +6 -0
  63. data/lib/bootstrap-on-rails/engine.rb +4 -0
  64. data/lib/bootstrap-on-rails/version.rb +3 -0
  65. data/test/test_helper.rb +2 -0
  66. metadata +112 -0
@@ -0,0 +1,127 @@
1
+ //
2
+ // Input groups
3
+ // --------------------------------------------------
4
+
5
+ // Base styles
6
+ // -------------------------
7
+ .input-group {
8
+ position: relative; // For dropdowns
9
+ display: table;
10
+ border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
11
+
12
+ // Undo padding and float of grid classes
13
+ &.col {
14
+ float: none;
15
+ padding-left: 0;
16
+ padding-right: 0;
17
+ }
18
+
19
+ .form-control {
20
+ width: 100%;
21
+ margin-bottom: 0;
22
+ }
23
+ }
24
+
25
+ // Sizing options
26
+ //
27
+ // Remix the default form control sizing classes into new ones for easier
28
+ // manipulation.
29
+
30
+ .input-group-lg > .form-control,
31
+ .input-group-lg > .input-group-addon,
32
+ .input-group-lg > .input-group-btn > .btn { .input-lg(); }
33
+ .input-group-sm > .form-control,
34
+ .input-group-sm > .input-group-addon,
35
+ .input-group-sm > .input-group-btn > .btn { .input-sm(); }
36
+
37
+
38
+ // Display as table-cell
39
+ // -------------------------
40
+ .input-group-addon,
41
+ .input-group-btn,
42
+ .input-group .form-control {
43
+ display: table-cell;
44
+
45
+ &:not(:first-child):not(:last-child) {
46
+ border-radius: 0;
47
+ }
48
+ }
49
+ // Addon and addon wrapper for buttons
50
+ .input-group-addon,
51
+ .input-group-btn {
52
+ width: 1%;
53
+ white-space: nowrap;
54
+ vertical-align: middle; // Match the inputs
55
+ }
56
+
57
+ // Text input groups
58
+ // -------------------------
59
+ .input-group-addon {
60
+ padding: @padding-base-vertical @padding-base-horizontal;
61
+ font-size: @font-size-base;
62
+ font-weight: normal;
63
+ line-height: 1;
64
+ text-align: center;
65
+ background-color: @input-group-addon-bg;
66
+ border: 1px solid @input-group-addon-border-color;
67
+ border-radius: @border-radius-base;
68
+
69
+ // Sizing
70
+ &.input-sm {
71
+ padding: @padding-small-vertical @padding-small-horizontal;
72
+ font-size: @font-size-small;
73
+ border-radius: @border-radius-small;
74
+ }
75
+ &.input-lg {
76
+ padding: @padding-large-vertical @padding-large-horizontal;
77
+ font-size: @font-size-large;
78
+ border-radius: @border-radius-large;
79
+ }
80
+
81
+ // Nuke default margins from checkboxes and radios to vertically center within.
82
+ input[type="radio"],
83
+ input[type="checkbox"] {
84
+ margin-top: 0;
85
+ }
86
+ }
87
+
88
+ // Reset rounded corners
89
+ .input-group .form-control:first-child,
90
+ .input-group-addon:first-child,
91
+ .input-group-btn:first-child > .btn,
92
+ .input-group-btn:first-child > .dropdown-toggle,
93
+ .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
94
+ .border-right-radius(0);
95
+ }
96
+ .input-group-addon:first-child {
97
+ border-right: 0;
98
+ }
99
+ .input-group .form-control:last-child,
100
+ .input-group-addon:last-child,
101
+ .input-group-btn:last-child > .btn,
102
+ .input-group-btn:last-child > .dropdown-toggle,
103
+ .input-group-btn:first-child > .btn:not(:first-child) {
104
+ .border-left-radius(0);
105
+ }
106
+ .input-group-addon:last-child {
107
+ border-left: 0;
108
+ }
109
+
110
+ // Button input groups
111
+ // -------------------------
112
+ .input-group-btn {
113
+ position: relative;
114
+ white-space: nowrap;
115
+ }
116
+ .input-group-btn > .btn {
117
+ position: relative;
118
+ // Jankily prevent input button groups from wrapping
119
+ + .btn {
120
+ margin-left: -4px;
121
+ }
122
+ // Bring the "active" button to the front
123
+ &:hover,
124
+ &:active {
125
+ z-index: 2;
126
+ }
127
+ }
@@ -0,0 +1,40 @@
1
+ //
2
+ // Jumbotron
3
+ // --------------------------------------------------
4
+
5
+
6
+ .jumbotron {
7
+ padding: @jumbotron-padding;
8
+ margin-bottom: @jumbotron-padding;
9
+ font-size: (@font-size-base * 1.5);
10
+ font-weight: 200;
11
+ line-height: (@line-height-base * 1.5);
12
+ color: @jumbotron-color;
13
+ background-color: @jumbotron-bg;
14
+
15
+ h1 {
16
+ line-height: 1;
17
+ color: @jumbotron-heading-color;
18
+ }
19
+ p {
20
+ line-height: 1.4;
21
+ }
22
+
23
+ .container & {
24
+ border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container
25
+ }
26
+
27
+ @media screen and (min-width: @screen-sm) {
28
+ padding-top: (@jumbotron-padding * 1.6);
29
+ padding-bottom: (@jumbotron-padding * 1.6);
30
+
31
+ .container & {
32
+ padding-left: (@jumbotron-padding * 2);
33
+ padding-right: (@jumbotron-padding * 2);
34
+ }
35
+
36
+ h1 {
37
+ font-size: (@font-size-base * 4.5);
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,58 @@
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
+
33
+ // Colors
34
+ // Contextual variations (linked labels get darker on :hover)
35
+
36
+ .label-default {
37
+ .label-variant(@label-default-bg);
38
+ }
39
+
40
+ .label-primary {
41
+ .label-variant(@label-primary-bg);
42
+ }
43
+
44
+ .label-success {
45
+ .label-variant(@label-success-bg);
46
+ }
47
+
48
+ .label-info {
49
+ .label-variant(@label-info-bg);
50
+ }
51
+
52
+ .label-warning {
53
+ .label-variant(@label-warning-bg);
54
+ }
55
+
56
+ .label-danger {
57
+ .label-variant(@label-danger-bg);
58
+ }
@@ -0,0 +1,88 @@
1
+ //
2
+ // List groups
3
+ // --------------------------------------------------
4
+
5
+ // Base class
6
+ //
7
+ // Easily usable on <ul>, <ol>, or <div>.
8
+ .list-group {
9
+ // No need to set list-style: none; since .list-group-item is block level
10
+ margin-bottom: 20px;
11
+ padding-left: 0; // reset padding because ul and ol
12
+ }
13
+
14
+ // Individual list items
15
+ // -------------------------
16
+
17
+ .list-group-item {
18
+ position: relative;
19
+ display: block;
20
+ padding: 10px 15px;
21
+ // Place the border on the list items and negative margin up for better styling
22
+ margin-bottom: -1px;
23
+ background-color: @list-group-bg;
24
+ border: 1px solid @list-group-border;
25
+
26
+ // Round the first and last items
27
+ &:first-child {
28
+ .border-top-radius(@list-group-border-radius);
29
+ }
30
+ &:last-child {
31
+ margin-bottom: 0;
32
+ .border-bottom-radius(@list-group-border-radius);
33
+ }
34
+
35
+ // Align badges within list items
36
+ > .badge {
37
+ float: right;
38
+ }
39
+ > .badge + .badge {
40
+ margin-right: 5px;
41
+ }
42
+
43
+ // Linked list items
44
+ a& {
45
+ color: @list-group-link-color;
46
+
47
+ .list-group-item-heading {
48
+ color: @list-group-link-heading-color;
49
+ }
50
+
51
+ // Hover state
52
+ &:hover,
53
+ &:focus {
54
+ text-decoration: none;
55
+ background-color: @list-group-hover-bg;
56
+ }
57
+ }
58
+
59
+ // Active class on item itself, not parent
60
+ &.active,
61
+ &.active:hover,
62
+ &.active:focus {
63
+ z-index: 2; // Place active items above their siblings for proper border styling
64
+ color: @list-group-active-color;
65
+ background-color: @list-group-active-bg;
66
+ border-color: @list-group-active-border;
67
+
68
+ // Force color to inherit for custom content
69
+ .list-group-item-heading {
70
+ color: inherit;
71
+ }
72
+ .list-group-item-text {
73
+ color: lighten(@list-group-active-bg, 40%);
74
+ }
75
+ }
76
+ }
77
+
78
+ // Custom content options
79
+ // -------------------------
80
+
81
+ .list-group-item-heading {
82
+ margin-top: 0;
83
+ margin-bottom: 5px;
84
+ }
85
+ .list-group-item-text {
86
+ margin-bottom: 0;
87
+ line-height: 1.3;
88
+ }
@@ -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,744 @@
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 #333;
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
+ &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
60
+ &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
61
+ }
62
+
63
+ // Text overflow
64
+ // Requires inline-block or block for proper styling
65
+ .text-overflow() {
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ // CSS image replacement
72
+ //
73
+ // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
74
+ // mixins being reused as classes with the same name, this doesn't hold up. As
75
+ // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
76
+ // that we cannot chain the mixins together in Less, so they are repeated.
77
+ //
78
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
79
+
80
+ // Deprecated as of v3.0.1 (will be removed in v4)
81
+ .hide-text() {
82
+ font: ~"0/0" a;
83
+ color: transparent;
84
+ text-shadow: none;
85
+ background-color: transparent;
86
+ border: 0;
87
+ }
88
+ // New mixin to use as of v3.0.1
89
+ .text-hide() {
90
+ font: ~"0/0" a;
91
+ color: transparent;
92
+ text-shadow: none;
93
+ background-color: transparent;
94
+ border: 0;
95
+ }
96
+
97
+
98
+
99
+ // CSS3 PROPERTIES
100
+ // --------------------------------------------------
101
+
102
+ // Single side border-radius
103
+ .border-top-radius(@radius) {
104
+ border-top-right-radius: @radius;
105
+ border-top-left-radius: @radius;
106
+ }
107
+ .border-right-radius(@radius) {
108
+ border-bottom-right-radius: @radius;
109
+ border-top-right-radius: @radius;
110
+ }
111
+ .border-bottom-radius(@radius) {
112
+ border-bottom-right-radius: @radius;
113
+ border-bottom-left-radius: @radius;
114
+ }
115
+ .border-left-radius(@radius) {
116
+ border-bottom-left-radius: @radius;
117
+ border-top-left-radius: @radius;
118
+ }
119
+
120
+ // Drop shadows
121
+ .box-shadow(@shadow) {
122
+ -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
123
+ box-shadow: @shadow;
124
+ }
125
+
126
+ // Transitions
127
+ .transition(@transition) {
128
+ -webkit-transition: @transition;
129
+ transition: @transition;
130
+ }
131
+ .transition-property(@transition-property) {
132
+ -webkit-transition-property: @transition-property;
133
+ transition-property: @transition-property;
134
+ }
135
+ .transition-delay(@transition-delay) {
136
+ -webkit-transition-delay: @transition-delay;
137
+ transition-delay: @transition-delay;
138
+ }
139
+ .transition-duration(@transition-duration) {
140
+ -webkit-transition-duration: @transition-duration;
141
+ transition-duration: @transition-duration;
142
+ }
143
+ .transition-transform(@transition) {
144
+ -webkit-transition: -webkit-transform @transition;
145
+ -moz-transition: -moz-transform @transition;
146
+ -o-transition: -o-transform @transition;
147
+ transition: transform @transition;
148
+ }
149
+
150
+ // Transformations
151
+ .rotate(@degrees) {
152
+ -webkit-transform: rotate(@degrees);
153
+ -ms-transform: rotate(@degrees); // IE9+
154
+ transform: rotate(@degrees);
155
+ }
156
+ .scale(@ratio) {
157
+ -webkit-transform: scale(@ratio);
158
+ -ms-transform: scale(@ratio); // IE9+
159
+ transform: scale(@ratio);
160
+ }
161
+ .translate(@x; @y) {
162
+ -webkit-transform: translate(@x, @y);
163
+ -ms-transform: translate(@x, @y); // IE9+
164
+ transform: translate(@x, @y);
165
+ }
166
+ .skew(@x; @y) {
167
+ -webkit-transform: skew(@x, @y);
168
+ -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
169
+ transform: skew(@x, @y);
170
+ }
171
+ .translate3d(@x; @y; @z) {
172
+ -webkit-transform: translate3d(@x, @y, @z);
173
+ transform: translate3d(@x, @y, @z);
174
+ }
175
+
176
+ // Backface visibility
177
+ // Prevent browsers from flickering when using CSS 3D transforms.
178
+ // Default value is `visible`, but can be changed to `hidden`
179
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
180
+ .backface-visibility(@visibility){
181
+ -webkit-backface-visibility: @visibility;
182
+ -moz-backface-visibility: @visibility;
183
+ backface-visibility: @visibility;
184
+ }
185
+
186
+ // Box sizing
187
+ .box-sizing(@boxmodel) {
188
+ -webkit-box-sizing: @boxmodel;
189
+ -moz-box-sizing: @boxmodel;
190
+ box-sizing: @boxmodel;
191
+ }
192
+
193
+ // User select
194
+ // For selecting text on the page
195
+ .user-select(@select) {
196
+ -webkit-user-select: @select;
197
+ -moz-user-select: @select;
198
+ -ms-user-select: @select; // IE10+
199
+ -o-user-select: @select;
200
+ user-select: @select;
201
+ }
202
+
203
+ // Resize anything
204
+ .resizable(@direction) {
205
+ resize: @direction; // Options: horizontal, vertical, both
206
+ overflow: auto; // Safari fix
207
+ }
208
+
209
+ // CSS3 Content Columns
210
+ .content-columns(@column-count; @column-gap: @grid-gutter-width) {
211
+ -webkit-column-count: @column-count;
212
+ -moz-column-count: @column-count;
213
+ column-count: @column-count;
214
+ -webkit-column-gap: @column-gap;
215
+ -moz-column-gap: @column-gap;
216
+ column-gap: @column-gap;
217
+ }
218
+
219
+ // Optional hyphenation
220
+ .hyphens(@mode: auto) {
221
+ word-wrap: break-word;
222
+ -webkit-hyphens: @mode;
223
+ -moz-hyphens: @mode;
224
+ -ms-hyphens: @mode; // IE10+
225
+ -o-hyphens: @mode;
226
+ hyphens: @mode;
227
+ }
228
+
229
+ // Opacity
230
+ .opacity(@opacity) {
231
+ opacity: @opacity;
232
+ // IE8 filter
233
+ @opacity-ie: (@opacity * 100);
234
+ filter: ~"alpha(opacity=@{opacity-ie})";
235
+ }
236
+
237
+
238
+
239
+ // GRADIENTS
240
+ // --------------------------------------------------
241
+
242
+ #gradient {
243
+
244
+ // Horizontal gradient, from left to right
245
+ //
246
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
247
+ // Color stops are not available in IE9 and below.
248
+ .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
249
+ background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
250
+ background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
251
+ background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
252
+ background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
253
+ background-repeat: repeat-x;
254
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
255
+ }
256
+
257
+ // Vertical gradient, from top to bottom
258
+ //
259
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
260
+ // Color stops are not available in IE9 and below.
261
+ .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
262
+ background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
263
+ background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
264
+ background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
265
+ background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
266
+ background-repeat: repeat-x;
267
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
268
+ }
269
+
270
+ .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
271
+ background-repeat: repeat-x;
272
+ background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
273
+ background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
274
+ background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
275
+ }
276
+ .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
277
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
278
+ background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
279
+ background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
280
+ background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
281
+ background-repeat: no-repeat;
282
+ 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
283
+ }
284
+ .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
285
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
286
+ background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
287
+ background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
288
+ background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
289
+ background-repeat: no-repeat;
290
+ 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
291
+ }
292
+ .radial(@inner-color: #555; @outer-color: #333) {
293
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
294
+ background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
295
+ background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
296
+ background-image: radial-gradient(circle, @inner-color, @outer-color);
297
+ background-repeat: no-repeat;
298
+ }
299
+ .striped(@color: #555; @angle: 45deg) {
300
+ background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
301
+ background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
302
+ background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
303
+ background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
304
+ }
305
+ }
306
+
307
+ // Reset filters for IE
308
+ //
309
+ // When you need to remove a gradient background, do not forget to use this to reset
310
+ // the IE filter for IE9 and below.
311
+ .reset-filter() {
312
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
313
+ }
314
+
315
+
316
+
317
+ // Retina images
318
+ //
319
+ // Short retina mixin for setting background-image and -size
320
+
321
+ .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
322
+ background-image: url("@{file-1x}");
323
+
324
+ @media
325
+ only screen and (-webkit-min-device-pixel-ratio: 2),
326
+ only screen and ( min--moz-device-pixel-ratio: 2),
327
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
328
+ only screen and ( min-device-pixel-ratio: 2),
329
+ only screen and ( min-resolution: 192dpi),
330
+ only screen and ( min-resolution: 2dppx) {
331
+ background-image: url("@{file-2x}");
332
+ background-size: @width-1x @height-1x;
333
+ }
334
+ }
335
+
336
+
337
+ // Responsive image
338
+ //
339
+ // Keep images from scaling beyond the width of their parents.
340
+
341
+ .img-responsive(@display: block;) {
342
+ display: @display;
343
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
344
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
345
+ }
346
+
347
+
348
+ // COMPONENT MIXINS
349
+ // --------------------------------------------------
350
+
351
+ // Horizontal dividers
352
+ // -------------------------
353
+ // Dividers (basically an hr) within dropdowns and nav lists
354
+ .nav-divider(@color: #e5e5e5) {
355
+ height: 1px;
356
+ margin: ((@line-height-computed / 2) - 1) 0;
357
+ overflow: hidden;
358
+ background-color: @color;
359
+ }
360
+
361
+ // Panels
362
+ // -------------------------
363
+ .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border;) {
364
+ border-color: @border;
365
+ & > .panel-heading {
366
+ color: @heading-text-color;
367
+ background-color: @heading-bg-color;
368
+ border-color: @heading-border;
369
+ + .panel-collapse .panel-body {
370
+ border-top-color: @border;
371
+ }
372
+ }
373
+ & > .panel-footer {
374
+ + .panel-collapse .panel-body {
375
+ border-bottom-color: @border;
376
+ }
377
+ }
378
+ }
379
+
380
+ // Alerts
381
+ // -------------------------
382
+ .alert-variant(@background; @border; @text-color) {
383
+ background-color: @background;
384
+ border-color: @border;
385
+ color: @text-color;
386
+ hr {
387
+ border-top-color: darken(@border, 5%);
388
+ }
389
+ .alert-link {
390
+ color: darken(@text-color, 10%);
391
+ }
392
+ }
393
+
394
+ // Tables
395
+ // -------------------------
396
+ .table-row-variant(@state; @background; @border) {
397
+ // Exact selectors below required to override `.table-striped` and prevent
398
+ // inheritance to nested tables.
399
+ .table > thead > tr,
400
+ .table > tbody > tr,
401
+ .table > tfoot > tr {
402
+ > td.@{state},
403
+ > th.@{state},
404
+ &.@{state} > td,
405
+ &.@{state} > th {
406
+ background-color: @background;
407
+ border-color: @border;
408
+ }
409
+ }
410
+
411
+ // Hover states for `.table-hover`
412
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
413
+ .table-hover > tbody > tr {
414
+ > td.@{state}:hover,
415
+ > th.@{state}:hover,
416
+ &.@{state}:hover > td,
417
+ &.@{state}:hover > th {
418
+ background-color: darken(@background, 5%);
419
+ border-color: darken(@border, 5%);
420
+ }
421
+ }
422
+ }
423
+
424
+ // Button variants
425
+ // -------------------------
426
+ // Easily pump out default styles, as well as :hover, :focus, :active,
427
+ // and disabled options for all buttons
428
+ .button-variant(@color; @background; @border) {
429
+ color: @color;
430
+ background-color: @background;
431
+ border-color: @border;
432
+
433
+ &:hover,
434
+ &:focus,
435
+ &:active,
436
+ &.active,
437
+ .open .dropdown-toggle& {
438
+ color: @color;
439
+ background-color: darken(@background, 8%);
440
+ border-color: darken(@border, 12%);
441
+ }
442
+ &:active,
443
+ &.active,
444
+ .open .dropdown-toggle& {
445
+ background-image: none;
446
+ }
447
+ &.disabled,
448
+ &[disabled],
449
+ fieldset[disabled] & {
450
+ &,
451
+ &:hover,
452
+ &:focus,
453
+ &:active,
454
+ &.active {
455
+ background-color: @background;
456
+ border-color: @border
457
+ }
458
+ }
459
+ }
460
+
461
+ // Button sizes
462
+ // -------------------------
463
+ .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
464
+ padding: @padding-vertical @padding-horizontal;
465
+ font-size: @font-size;
466
+ line-height: @line-height;
467
+ border-radius: @border-radius;
468
+ }
469
+
470
+ // Pagination
471
+ // -------------------------
472
+ .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
473
+ > li {
474
+ > a,
475
+ > span {
476
+ padding: @padding-vertical @padding-horizontal;
477
+ font-size: @font-size;
478
+ }
479
+ &:first-child {
480
+ > a,
481
+ > span {
482
+ .border-left-radius(@border-radius);
483
+ }
484
+ }
485
+ &:last-child {
486
+ > a,
487
+ > span {
488
+ .border-right-radius(@border-radius);
489
+ }
490
+ }
491
+ }
492
+ }
493
+
494
+ // Labels
495
+ // -------------------------
496
+ .label-variant(@color) {
497
+ background-color: @color;
498
+ &[href] {
499
+ &:hover,
500
+ &:focus {
501
+ background-color: darken(@color, 10%);
502
+ }
503
+ }
504
+ }
505
+
506
+ // Navbar vertical align
507
+ // -------------------------
508
+ // Vertically center elements in the navbar.
509
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
510
+ .navbar-vertical-align(@element-height) {
511
+ margin-top: ((@navbar-height - @element-height) / 2);
512
+ margin-bottom: ((@navbar-height - @element-height) / 2);
513
+ }
514
+
515
+ // Progress bars
516
+ // -------------------------
517
+ .progress-bar-variant(@color) {
518
+ background-color: @color;
519
+ .progress-striped & {
520
+ #gradient > .striped(@color);
521
+ }
522
+ }
523
+
524
+ // Responsive utilities
525
+ // -------------------------
526
+ // More easily include all the states for responsive-utilities.less.
527
+ .responsive-visibility() {
528
+ display: block !important;
529
+ tr& { display: table-row !important; }
530
+ th&,
531
+ td& { display: table-cell !important; }
532
+ }
533
+
534
+ .responsive-invisibility() {
535
+ display: none !important;
536
+ tr& { display: none !important; }
537
+ th&,
538
+ td& { display: none !important; }
539
+ }
540
+
541
+ // Grid System
542
+ // -----------
543
+
544
+ // Centered container element
545
+ .container-fixed() {
546
+ margin-right: auto;
547
+ margin-left: auto;
548
+ padding-left: (@grid-gutter-width / 2);
549
+ padding-right: (@grid-gutter-width / 2);
550
+ .clearfix();
551
+ }
552
+
553
+ // Creates a wrapper for a series of columns
554
+ .make-row(@gutter: @grid-gutter-width) {
555
+ margin-left: (@gutter / -2);
556
+ margin-right: (@gutter / -2);
557
+ .clearfix();
558
+ }
559
+
560
+ // Generate the extra small columns
561
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
562
+ position: relative;
563
+ float: left;
564
+ width: percentage((@columns / @grid-columns));
565
+ // Prevent columns from collapsing when empty
566
+ min-height: 1px;
567
+ // Inner gutter via padding
568
+ padding-left: (@gutter / 2);
569
+ padding-right: (@gutter / 2);
570
+ }
571
+
572
+ // Generate the small columns
573
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
574
+ position: relative;
575
+ // Prevent columns from collapsing when empty
576
+ min-height: 1px;
577
+ // Inner gutter via padding
578
+ padding-left: (@gutter / 2);
579
+ padding-right: (@gutter / 2);
580
+
581
+ // Calculate width based on number of columns available
582
+ @media (min-width: @screen-sm-min) {
583
+ float: left;
584
+ width: percentage((@columns / @grid-columns));
585
+ }
586
+ }
587
+
588
+ // Generate the small column offsets
589
+ .make-sm-column-offset(@columns) {
590
+ @media (min-width: @screen-sm-min) {
591
+ margin-left: percentage((@columns / @grid-columns));
592
+ }
593
+ }
594
+ .make-sm-column-push(@columns) {
595
+ @media (min-width: @screen-sm-min) {
596
+ left: percentage((@columns / @grid-columns));
597
+ }
598
+ }
599
+ .make-sm-column-pull(@columns) {
600
+ @media (min-width: @screen-sm-min) {
601
+ right: percentage((@columns / @grid-columns));
602
+ }
603
+ }
604
+
605
+ // Generate the medium columns
606
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
607
+ position: relative;
608
+ // Prevent columns from collapsing when empty
609
+ min-height: 1px;
610
+ // Inner gutter via padding
611
+ padding-left: (@gutter / 2);
612
+ padding-right: (@gutter / 2);
613
+
614
+ // Calculate width based on number of columns available
615
+ @media (min-width: @screen-md-min) {
616
+ float: left;
617
+ width: percentage((@columns / @grid-columns));
618
+ }
619
+ }
620
+
621
+ // Generate the large column offsets
622
+ .make-md-column-offset(@columns) {
623
+ @media (min-width: @screen-md-min) {
624
+ margin-left: percentage((@columns / @grid-columns));
625
+ }
626
+ }
627
+ .make-md-column-push(@columns) {
628
+ @media (min-width: @screen-md) {
629
+ left: percentage((@columns / @grid-columns));
630
+ }
631
+ }
632
+ .make-md-column-pull(@columns) {
633
+ @media (min-width: @screen-md-min) {
634
+ right: percentage((@columns / @grid-columns));
635
+ }
636
+ }
637
+
638
+ // Generate the large columns
639
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
640
+ position: relative;
641
+ // Prevent columns from collapsing when empty
642
+ min-height: 1px;
643
+ // Inner gutter via padding
644
+ padding-left: (@gutter / 2);
645
+ padding-right: (@gutter / 2);
646
+
647
+ // Calculate width based on number of columns available
648
+ @media (min-width: @screen-lg-min) {
649
+ float: left;
650
+ width: percentage((@columns / @grid-columns));
651
+ }
652
+ }
653
+
654
+ // Generate the large column offsets
655
+ .make-lg-column-offset(@columns) {
656
+ @media (min-width: @screen-lg-min) {
657
+ margin-left: percentage((@columns / @grid-columns));
658
+ }
659
+ }
660
+ .make-lg-column-push(@columns) {
661
+ @media (min-width: @screen-lg-min) {
662
+ left: percentage((@columns / @grid-columns));
663
+ }
664
+ }
665
+ .make-lg-column-pull(@columns) {
666
+ @media (min-width: @screen-lg-min) {
667
+ right: percentage((@columns / @grid-columns));
668
+ }
669
+ }
670
+
671
+
672
+ // Form validation states
673
+ //
674
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
675
+ // and successes.
676
+
677
+ .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
678
+ // Color the label and help text
679
+ .help-block,
680
+ .control-label {
681
+ color: @text-color;
682
+ }
683
+ // Set the border and box shadow on specific inputs to match
684
+ .form-control {
685
+ border-color: @border-color;
686
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
687
+ &:focus {
688
+ border-color: darken(@border-color, 10%);
689
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
690
+ .box-shadow(@shadow);
691
+ }
692
+ }
693
+ // Set validation states also for addons
694
+ .input-group-addon {
695
+ color: @text-color;
696
+ border-color: @border-color;
697
+ background-color: @background-color;
698
+ }
699
+ }
700
+
701
+ // Form control focus state
702
+ //
703
+ // Generate a customized focus state and for any input with the specified color,
704
+ // which defaults to the `@input-focus-border` variable.
705
+ //
706
+ // We highly encourage you to not customize the default value, but instead use
707
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
708
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
709
+ // usability and accessibility should be taken into account with any change.
710
+ //
711
+ // Example usage: change the default blue border and shadow to white for better
712
+ // contrast against a dark gray background.
713
+
714
+ .form-control-focus(@color: @input-border-focus) {
715
+ @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
716
+ &:focus {
717
+ border-color: @color;
718
+ outline: 0;
719
+ .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
720
+ }
721
+ }
722
+
723
+ // Form control sizing
724
+ //
725
+ // Relative text size, padding, and border-radii changes for form controls. For
726
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
727
+ // element gets special love because it's special, and that's a fact!
728
+
729
+ .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
730
+ height: @input-height;
731
+ padding: @padding-vertical @padding-horizontal;
732
+ font-size: @font-size;
733
+ line-height: @line-height;
734
+ border-radius: @border-radius;
735
+
736
+ select& {
737
+ height: @input-height;
738
+ line-height: @input-height;
739
+ }
740
+
741
+ textarea& {
742
+ height: auto;
743
+ }
744
+ }