flipper-ui 0.12.2 → 0.13.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/docs/ui/README.md +21 -3
  3. data/docs/ui/images/configured-ui.png +0 -0
  4. data/docs/ui/images/environment-banner.png +0 -0
  5. data/docs/ui/images/feature.png +0 -0
  6. data/docs/ui/images/features.png +0 -0
  7. data/lib/flipper/ui/assets/javascripts/application.coffee +3 -0
  8. data/lib/flipper/ui/assets/stylesheets/.DS_Store +0 -0
  9. data/lib/flipper/ui/assets/stylesheets/application.scss +9 -48
  10. data/lib/flipper/ui/assets/stylesheets/bootstrap/_alert.scss +51 -0
  11. data/lib/flipper/ui/assets/stylesheets/bootstrap/_badge.scss +47 -0
  12. data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumb.scss +38 -0
  13. data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-group.scss +166 -0
  14. data/lib/flipper/ui/assets/stylesheets/bootstrap/_buttons.scss +78 -95
  15. data/lib/flipper/ui/assets/stylesheets/bootstrap/_card.scss +270 -0
  16. data/lib/flipper/ui/assets/stylesheets/bootstrap/_carousel.scss +122 -200
  17. data/lib/flipper/ui/assets/stylesheets/bootstrap/_close.scss +12 -14
  18. data/lib/flipper/ui/assets/stylesheets/bootstrap/_code.scss +15 -28
  19. data/lib/flipper/ui/assets/stylesheets/bootstrap/_custom-forms.scss +297 -0
  20. data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdown.scss +131 -0
  21. data/lib/flipper/ui/assets/stylesheets/bootstrap/_forms.scss +210 -455
  22. data/lib/flipper/ui/assets/stylesheets/bootstrap/_functions.scss +86 -0
  23. data/lib/flipper/ui/assets/stylesheets/bootstrap/_grid.scss +29 -61
  24. data/lib/flipper/ui/assets/stylesheets/bootstrap/_images.scss +42 -0
  25. data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-group.scss +159 -0
  26. data/lib/flipper/ui/assets/stylesheets/bootstrap/_jumbotron.scss +8 -42
  27. data/lib/flipper/ui/assets/stylesheets/bootstrap/_list-group.scss +64 -73
  28. data/lib/flipper/ui/assets/stylesheets/bootstrap/_media.scss +3 -56
  29. data/lib/flipper/ui/assets/stylesheets/bootstrap/_mixins.scss +21 -18
  30. data/lib/flipper/ui/assets/stylesheets/bootstrap/_modal.scss +168 -0
  31. data/lib/flipper/ui/assets/stylesheets/bootstrap/_nav.scss +118 -0
  32. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navbar.scss +203 -554
  33. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pagination.scss +58 -69
  34. data/lib/flipper/ui/assets/stylesheets/bootstrap/_popover.scss +183 -0
  35. data/lib/flipper/ui/assets/stylesheets/bootstrap/_print.scss +71 -54
  36. data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress.scss +33 -0
  37. data/lib/flipper/ui/assets/stylesheets/bootstrap/_reboot.scss +482 -0
  38. data/lib/flipper/ui/assets/stylesheets/bootstrap/_root.scss +19 -0
  39. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tables.scss +109 -163
  40. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tooltip.scss +97 -84
  41. data/lib/flipper/ui/assets/stylesheets/bootstrap/_transitions.scss +36 -0
  42. data/lib/flipper/ui/assets/stylesheets/bootstrap/_type.scss +66 -239
  43. data/lib/flipper/ui/assets/stylesheets/bootstrap/_utilities.scss +14 -55
  44. data/lib/flipper/ui/assets/stylesheets/bootstrap/_variables.scss +726 -698
  45. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-grid.scss +32 -0
  46. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-reboot.scss +12 -0
  47. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap.scss +42 -0
  48. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
  49. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_background-variant.scss +14 -4
  50. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_badge.scss +12 -0
  51. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_border-radius.scss +25 -8
  52. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
  53. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
  54. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_buttons.scss +89 -32
  55. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_caret.scss +65 -0
  56. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_clearfix.scss +3 -18
  57. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_float.scss +11 -0
  58. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_forms.scss +115 -66
  59. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_gradients.scss +14 -27
  60. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +52 -66
  61. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid.scss +37 -107
  62. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hover.scss +39 -0
  63. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_image.scss +18 -15
  64. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_list-group.scss +10 -20
  65. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
  66. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +3 -3
  67. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +10 -0
  68. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_pagination.scss +10 -11
  69. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
  70. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  71. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +35 -0
  72. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_size.scss +1 -5
  73. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_table-row.scss +16 -14
  74. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +7 -4
  75. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-hide.scss +9 -0
  76. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/{_text-overflow.scss → _text-truncate.scss} +2 -2
  77. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_transition.scss +9 -0
  78. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_visibility.scss +7 -0
  79. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
  80. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
  81. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_borders.scss +59 -0
  82. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
  83. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_display.scss +38 -0
  84. data/lib/flipper/ui/assets/stylesheets/bootstrap/{_responsive-embed.scss → utilities/_embed.scss} +26 -9
  85. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_flex.scss +46 -0
  86. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_float.scss +9 -0
  87. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_position.scss +36 -0
  88. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
  89. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_sizing.scss +12 -0
  90. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_spacing.scss +51 -0
  91. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_text.scss +52 -0
  92. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_visibility.scss +11 -0
  93. data/lib/flipper/ui/configuration.rb +24 -0
  94. data/lib/flipper/ui/decorators/feature.rb +3 -3
  95. data/lib/flipper/ui/public/css/application.css +6237 -2339
  96. data/lib/flipper/ui/public/js/application.js +3 -2
  97. data/lib/flipper/ui/views/add_actor.erb +7 -9
  98. data/lib/flipper/ui/views/add_feature.erb +8 -10
  99. data/lib/flipper/ui/views/add_group.erb +7 -9
  100. data/lib/flipper/ui/views/feature.erb +181 -141
  101. data/lib/flipper/ui/views/feature_creation_disabled.erb +1 -1
  102. data/lib/flipper/ui/views/feature_removal_disabled.erb +1 -1
  103. data/lib/flipper/ui/views/features.erb +12 -15
  104. data/lib/flipper/ui/views/layout.erb +25 -15
  105. data/lib/flipper/version.rb +1 -1
  106. data/spec/flipper/ui/actions/actors_gate_spec.rb +2 -1
  107. data/spec/flipper/ui/actions/add_feature_spec.rb +2 -1
  108. data/spec/flipper/ui/actions/groups_gate_spec.rb +2 -1
  109. data/spec/flipper/ui/configuration_spec.rb +27 -0
  110. data/spec/flipper/ui_spec.rb +24 -0
  111. metadata +58 -64
  112. data/lib/flipper/ui/assets/stylesheets/_bootstrap-compass.scss +0 -9
  113. data/lib/flipper/ui/assets/stylesheets/_bootstrap-mincer.scss +0 -19
  114. data/lib/flipper/ui/assets/stylesheets/_bootstrap-sprockets.scss +0 -9
  115. data/lib/flipper/ui/assets/stylesheets/_bootstrap.scss +0 -50
  116. data/lib/flipper/ui/assets/stylesheets/bootstrap/_alerts.scss +0 -73
  117. data/lib/flipper/ui/assets/stylesheets/bootstrap/_badges.scss +0 -68
  118. data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumbs.scss +0 -26
  119. data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-groups.scss +0 -243
  120. data/lib/flipper/ui/assets/stylesheets/bootstrap/_component-animations.scss +0 -37
  121. data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdowns.scss +0 -214
  122. data/lib/flipper/ui/assets/stylesheets/bootstrap/_glyphicons.scss +0 -305
  123. data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-groups.scss +0 -166
  124. data/lib/flipper/ui/assets/stylesheets/bootstrap/_labels.scss +0 -66
  125. data/lib/flipper/ui/assets/stylesheets/bootstrap/_modals.scss +0 -150
  126. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navs.scss +0 -242
  127. data/lib/flipper/ui/assets/stylesheets/bootstrap/_normalize.scss +0 -427
  128. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pager.scss +0 -54
  129. data/lib/flipper/ui/assets/stylesheets/bootstrap/_panels.scss +0 -265
  130. data/lib/flipper/ui/assets/stylesheets/bootstrap/_popovers.scss +0 -135
  131. data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress-bars.scss +0 -87
  132. data/lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-utilities.scss +0 -177
  133. data/lib/flipper/ui/assets/stylesheets/bootstrap/_scaffolding.scss +0 -162
  134. data/lib/flipper/ui/assets/stylesheets/bootstrap/_theme.scss +0 -273
  135. data/lib/flipper/ui/assets/stylesheets/bootstrap/_thumbnails.scss +0 -38
  136. data/lib/flipper/ui/assets/stylesheets/bootstrap/_wells.scss +0 -29
  137. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alerts.scss +0 -14
  138. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_center-block.scss +0 -7
  139. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hide-text.scss +0 -21
  140. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_labels.scss +0 -12
  141. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -9
  142. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_opacity.scss +0 -8
  143. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_panels.scss +0 -24
  144. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +0 -10
  145. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
  146. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -21
  147. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
  148. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -222
  149. data/lib/flipper/ui/public/css/primer.css +0 -1
  150. data/lib/flipper/ui/public/css/primer/primer.css +0 -1933
  151. data/lib/flipper/ui/public/css/scss/primer.css +0 -1933
  152. data/lib/flipper/ui/public/js/bootstrap-sprockets.js +0 -12
  153. data/lib/flipper/ui/public/js/bootstrap.js +0 -2317
  154. data/lib/flipper/ui/public/js/bootstrap.min.js +0 -7
  155. data/lib/flipper/ui/public/js/bootstrap/affix.js +0 -162
  156. data/lib/flipper/ui/public/js/bootstrap/alert.js +0 -94
  157. data/lib/flipper/ui/public/js/bootstrap/button.js +0 -116
  158. data/lib/flipper/ui/public/js/bootstrap/carousel.js +0 -237
  159. data/lib/flipper/ui/public/js/bootstrap/collapse.js +0 -211
  160. data/lib/flipper/ui/public/js/bootstrap/dropdown.js +0 -161
  161. data/lib/flipper/ui/public/js/bootstrap/modal.js +0 -339
  162. data/lib/flipper/ui/public/js/bootstrap/popover.js +0 -108
  163. data/lib/flipper/ui/public/js/bootstrap/scrollspy.js +0 -172
  164. data/lib/flipper/ui/public/js/bootstrap/tab.js +0 -153
  165. data/lib/flipper/ui/public/js/bootstrap/tooltip.js +0 -476
  166. data/lib/flipper/ui/public/js/bootstrap/transition.js +0 -59
@@ -1,312 +1,134 @@
1
- //
2
- // Forms
3
- // --------------------------------------------------
4
-
1
+ // stylelint-disable selector-no-qualifying-type
5
2
 
6
- // Normalize non-controls
7
3
  //
8
- // Restyle and baseline non-control form elements.
9
-
10
- fieldset {
11
- padding: 0;
12
- margin: 0;
13
- border: 0;
14
- // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
15
- // so we reset that to ensure it behaves more like a standard block element.
16
- // See https://github.com/twbs/bootstrap/issues/12359.
17
- min-width: 0;
18
- }
19
-
20
- legend {
21
- display: block;
22
- width: 100%;
23
- padding: 0;
24
- margin-bottom: $line-height-computed;
25
- font-size: ($font-size-base * 1.5);
26
- line-height: inherit;
27
- color: $legend-color;
28
- border: 0;
29
- border-bottom: 1px solid $legend-border-color;
30
- }
31
-
32
- label {
33
- display: inline-block;
34
- max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)
35
- margin-bottom: 5px;
36
- font-weight: bold;
37
- }
38
-
39
-
40
- // Normalize form controls
4
+ // Textual form controls
41
5
  //
42
- // While most of our form styles require extra classes, some basic normalization
43
- // is required to ensure optimum display with or without those classes to better
44
- // address browser inconsistencies.
45
-
46
- // Override content-box in Normalize (* isn't specific enough)
47
- input[type="search"] {
48
- @include box-sizing(border-box);
49
- }
50
-
51
- // Position radios and checkboxes better
52
- input[type="radio"],
53
- input[type="checkbox"] {
54
- margin: 4px 0 0;
55
- margin-top: 1px \9; // IE8-9
56
- line-height: normal;
57
- }
58
-
59
- // Set the height of file controls to match text inputs
60
- input[type="file"] {
61
- display: block;
62
- }
63
-
64
- // Make range inputs behave like textual form controls
65
- input[type="range"] {
66
- display: block;
67
- width: 100%;
68
- }
69
-
70
- // Make multiple select elements height not fixed
71
- select[multiple],
72
- select[size] {
73
- height: auto;
74
- }
75
-
76
- // Focus for file, radio, and checkbox
77
- input[type="file"]:focus,
78
- input[type="radio"]:focus,
79
- input[type="checkbox"]:focus {
80
- @include tab-focus;
81
- }
82
-
83
- // Adjust output element
84
- output {
85
- display: block;
86
- padding-top: ($padding-base-vertical + 1);
87
- font-size: $font-size-base;
88
- line-height: $line-height-base;
89
- color: $input-color;
90
- }
91
-
92
-
93
- // Common form controls
94
- //
95
- // Shared size and type resets for form controls. Apply `.form-control` to any
96
- // of the following form controls:
97
- //
98
- // select
99
- // textarea
100
- // input[type="text"]
101
- // input[type="password"]
102
- // input[type="datetime"]
103
- // input[type="datetime-local"]
104
- // input[type="date"]
105
- // input[type="month"]
106
- // input[type="time"]
107
- // input[type="week"]
108
- // input[type="number"]
109
- // input[type="email"]
110
- // input[type="url"]
111
- // input[type="search"]
112
- // input[type="tel"]
113
- // input[type="color"]
114
6
 
115
7
  .form-control {
116
8
  display: block;
117
9
  width: 100%;
118
- height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
119
- padding: $padding-base-vertical $padding-base-horizontal;
10
+ padding: $input-padding-y $input-padding-x;
120
11
  font-size: $font-size-base;
121
- line-height: $line-height-base;
12
+ line-height: $input-line-height;
122
13
  color: $input-color;
123
14
  background-color: $input-bg;
124
- background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
125
- border: 1px solid $input-border;
126
- border-radius: $input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of <select>s in CSS.
127
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
128
- @include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);
15
+ background-clip: padding-box;
16
+ border: $input-border-width solid $input-border-color;
17
+
18
+ // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
19
+ @if $enable-rounded {
20
+ // Manually use the if/else instead of the mixin to account for iOS override
21
+ border-radius: $input-border-radius;
22
+ } @else {
23
+ // Otherwise undo the iOS default
24
+ border-radius: 0;
25
+ }
26
+
27
+ @include box-shadow($input-box-shadow);
28
+ @include transition($input-transition);
29
+
30
+ // Unstyle the caret on `<select>`s in IE10+.
31
+ &::-ms-expand {
32
+ background-color: transparent;
33
+ border: 0;
34
+ }
129
35
 
130
36
  // Customize the `:focus` state to imitate native WebKit styles.
131
- @include form-control-focus;
37
+ @include form-control-focus();
132
38
 
133
39
  // Placeholder
134
- @include placeholder;
40
+ &::placeholder {
41
+ color: $input-placeholder-color;
42
+ // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
43
+ opacity: 1;
44
+ }
135
45
 
136
46
  // Disabled and read-only inputs
137
47
  //
138
48
  // HTML5 says that controls under a fieldset > legend:first-child won't be
139
49
  // disabled if the fieldset is disabled. Due to implementation difficulty, we
140
50
  // don't honor that edge case; we style them as disabled anyway.
141
- &[disabled],
142
- &[readonly],
143
- fieldset[disabled] & {
144
- background-color: $input-bg-disabled;
145
- opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655
51
+ &:disabled,
52
+ &[readonly] {
53
+ background-color: $input-disabled-bg;
54
+ // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
55
+ opacity: 1;
146
56
  }
57
+ }
147
58
 
148
- &[disabled],
149
- fieldset[disabled] & {
150
- cursor: $cursor-disabled;
59
+ select.form-control {
60
+ &:not([size]):not([multiple]) {
61
+ height: $input-height;
151
62
  }
152
63
 
153
- // [converter] extracted textarea& to textarea.form-control
154
- }
155
-
156
- // Reset height for `textarea`s
157
- textarea.form-control {
158
- height: auto;
64
+ &:focus::-ms-value {
65
+ // Suppress the nested default white text on blue background highlight given to
66
+ // the selected option text when the (still closed) <select> receives focus
67
+ // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
68
+ // match the appearance of the native widget.
69
+ // See https://github.com/twbs/bootstrap/issues/19398.
70
+ color: $input-color;
71
+ background-color: $input-bg;
72
+ }
159
73
  }
160
74
 
161
-
162
- // Search inputs in iOS
163
- //
164
- // This overrides the extra rounded corners on search inputs in iOS so that our
165
- // `.form-control` class can properly style them. Note that this cannot simply
166
- // be added to `.form-control` as it's not specific enough. For details, see
167
- // https://github.com/twbs/bootstrap/issues/11586.
168
-
169
- input[type="search"] {
170
- -webkit-appearance: none;
75
+ // Make file inputs better match text inputs by forcing them to new lines.
76
+ .form-control-file,
77
+ .form-control-range {
78
+ display: block;
79
+ width: 100%;
171
80
  }
172
81
 
173
82
 
174
- // Special styles for iOS temporal inputs
175
83
  //
176
- // In Mobile Safari, setting `display: block` on temporal inputs causes the
177
- // text within the input to become vertically misaligned. As a workaround, we
178
- // set a pixel line-height that matches the given height of the input, but only
179
- // for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848
180
-
181
- @media screen and (-webkit-min-device-pixel-ratio: 0) {
182
- input[type="date"],
183
- input[type="time"],
184
- input[type="datetime-local"],
185
- input[type="month"] {
186
- line-height: $input-height-base;
187
-
188
- &.input-sm,
189
- .input-group-sm & {
190
- line-height: $input-height-small;
191
- }
192
-
193
- &.input-lg,
194
- .input-group-lg & {
195
- line-height: $input-height-large;
196
- }
197
- }
198
- }
199
-
200
-
201
- // Form groups
84
+ // Labels
202
85
  //
203
- // Designed to help with the organization and spacing of vertical forms. For
204
- // horizontal forms, use the predefined grid classes.
205
86
 
206
- .form-group {
207
- margin-bottom: $form-group-margin-bottom;
87
+ // For use with horizontal and inline forms, when you need the label (or legend)
88
+ // text to align with the form controls.
89
+ .col-form-label {
90
+ padding-top: calc(#{$input-padding-y} + #{$input-border-width});
91
+ padding-bottom: calc(#{$input-padding-y} + #{$input-border-width});
92
+ margin-bottom: 0; // Override the `<label>/<legend>` default
93
+ font-size: inherit; // Override the `<legend>` default
94
+ line-height: $input-line-height;
208
95
  }
209
96
 
210
-
211
- // Checkboxes and radios
212
- //
213
- // Indent the labels to position radios/checkboxes as hanging controls.
214
-
215
- .radio,
216
- .checkbox {
217
- position: relative;
218
- display: block;
219
- margin-top: 10px;
220
- margin-bottom: 10px;
221
-
222
- label {
223
- min-height: $line-height-computed; // Ensure the input doesn't jump when there is no text
224
- padding-left: 20px;
225
- margin-bottom: 0;
226
- font-weight: normal;
227
- cursor: pointer;
228
- }
229
- }
230
- .radio input[type="radio"],
231
- .radio-inline input[type="radio"],
232
- .checkbox input[type="checkbox"],
233
- .checkbox-inline input[type="checkbox"] {
234
- position: absolute;
235
- margin-left: -20px;
236
- margin-top: 4px \9;
97
+ .col-form-label-lg {
98
+ padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width});
99
+ padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width});
100
+ font-size: $font-size-lg;
101
+ line-height: $input-line-height-lg;
237
102
  }
238
103
 
239
- .radio + .radio,
240
- .checkbox + .checkbox {
241
- margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
104
+ .col-form-label-sm {
105
+ padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width});
106
+ padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width});
107
+ font-size: $font-size-sm;
108
+ line-height: $input-line-height-sm;
242
109
  }
243
110
 
244
- // Radios and checkboxes on same line
245
- .radio-inline,
246
- .checkbox-inline {
247
- position: relative;
248
- display: inline-block;
249
- padding-left: 20px;
250
- margin-bottom: 0;
251
- vertical-align: middle;
252
- font-weight: normal;
253
- cursor: pointer;
254
- }
255
- .radio-inline + .radio-inline,
256
- .checkbox-inline + .checkbox-inline {
257
- margin-top: 0;
258
- margin-left: 10px; // space out consecutive inline controls
259
- }
260
111
 
261
- // Apply same disabled cursor tweak as for inputs
262
- // Some special care is needed because <label>s don't inherit their parent's `cursor`.
112
+ // Readonly controls as plain text
263
113
  //
264
- // Note: Neither radios nor checkboxes can be readonly.
265
- input[type="radio"],
266
- input[type="checkbox"] {
267
- &[disabled],
268
- &.disabled,
269
- fieldset[disabled] & {
270
- cursor: $cursor-disabled;
271
- }
272
- }
273
- // These classes are used directly on <label>s
274
- .radio-inline,
275
- .checkbox-inline {
276
- &.disabled,
277
- fieldset[disabled] & {
278
- cursor: $cursor-disabled;
279
- }
280
- }
281
- // These classes are used on elements with <label> descendants
282
- .radio,
283
- .checkbox {
284
- &.disabled,
285
- fieldset[disabled] & {
286
- label {
287
- cursor: $cursor-disabled;
288
- }
289
- }
290
- }
291
-
114
+ // Apply class to a readonly input to make it appear like regular plain
115
+ // text (without any border, background color, focus indicator)
292
116
 
293
- // Static form control text
294
- //
295
- // Apply class to a `p` element to make any string of text align with labels in
296
- // a horizontal form layout.
297
-
298
- .form-control-static {
299
- // Size it appropriately next to real form controls
300
- padding-top: ($padding-base-vertical + 1);
301
- padding-bottom: ($padding-base-vertical + 1);
302
- // Remove default margin from `p`
303
- margin-bottom: 0;
304
- min-height: ($line-height-computed + $font-size-base);
305
-
306
- &.input-lg,
307
- &.input-sm {
308
- padding-left: 0;
117
+ .form-control-plaintext {
118
+ display: block;
119
+ width: 100%;
120
+ padding-top: $input-padding-y;
121
+ padding-bottom: $input-padding-y;
122
+ margin-bottom: 0; // match inputs if this class comes on inputs with default margins
123
+ line-height: $input-line-height;
124
+ background-color: transparent;
125
+ border: solid transparent;
126
+ border-width: $input-border-width 0;
127
+
128
+ &.form-control-sm,
129
+ &.form-control-lg {
309
130
  padding-right: 0;
131
+ padding-left: 0;
310
132
  }
311
133
  }
312
134
 
@@ -319,107 +141,115 @@ input[type="checkbox"] {
319
141
  // The `.form-group-* form-control` variations are sadly duplicated to avoid the
320
142
  // issue documented in https://github.com/twbs/bootstrap/issues/15074.
321
143
 
322
- @include input-size('.input-sm', $input-height-small, $padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $input-border-radius-small);
323
- .form-group-sm {
324
-
325
- @include input-size('.form-control', $input-height-small, $padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $input-border-radius-small);
144
+ .form-control-sm {
145
+ padding: $input-padding-y-sm $input-padding-x-sm;
146
+ font-size: $font-size-sm;
147
+ line-height: $input-line-height-sm;
148
+ @include border-radius($input-border-radius-sm);
149
+ }
326
150
 
327
- .form-control-static {
328
- height: $input-height-small;
329
- padding: $padding-small-vertical $padding-small-horizontal;
330
- font-size: $font-size-small;
331
- line-height: $line-height-small;
332
- min-height: ($line-height-computed + $font-size-small);
151
+ select.form-control-sm {
152
+ &:not([size]):not([multiple]) {
153
+ height: $input-height-sm;
333
154
  }
334
155
  }
335
156
 
336
- @include input-size('.input-lg', $input-height-large, $padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $input-border-radius-large);
337
- .form-group-lg {
338
-
339
- @include input-size('.form-control', $input-height-large, $padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $input-border-radius-large);
157
+ .form-control-lg {
158
+ padding: $input-padding-y-lg $input-padding-x-lg;
159
+ font-size: $font-size-lg;
160
+ line-height: $input-line-height-lg;
161
+ @include border-radius($input-border-radius-lg);
162
+ }
340
163
 
341
- .form-control-static {
342
- height: $input-height-large;
343
- padding: $padding-large-vertical $padding-large-horizontal;
344
- font-size: $font-size-large;
345
- line-height: $line-height-large;
346
- min-height: ($line-height-computed + $font-size-large);
164
+ select.form-control-lg {
165
+ &:not([size]):not([multiple]) {
166
+ height: $input-height-lg;
347
167
  }
348
168
  }
349
169
 
350
170
 
351
- // Form control feedback states
171
+ // Form groups
352
172
  //
353
- // Apply contextual and semantic states to individual form controls.
354
-
355
- .has-feedback {
356
- // Enable absolute positioning
357
- position: relative;
173
+ // Designed to help with the organization and spacing of vertical forms. For
174
+ // horizontal forms, use the predefined grid classes.
358
175
 
359
- // Ensure icons don't overlap text
360
- .form-control {
361
- padding-right: ($input-height-base * 1.25);
362
- }
176
+ .form-group {
177
+ margin-bottom: $form-group-margin-bottom;
363
178
  }
364
- // Feedback icon (requires .glyphicon classes)
365
- .form-control-feedback {
366
- position: absolute;
367
- top: 0;
368
- right: 0;
369
- z-index: 2; // Ensure icon is above input groups
179
+
180
+ .form-text {
370
181
  display: block;
371
- width: $input-height-base;
372
- height: $input-height-base;
373
- line-height: $input-height-base;
374
- text-align: center;
375
- pointer-events: none;
376
- }
377
- .input-lg + .form-control-feedback {
378
- width: $input-height-large;
379
- height: $input-height-large;
380
- line-height: $input-height-large;
182
+ margin-top: $form-text-margin-top;
381
183
  }
382
- .input-sm + .form-control-feedback {
383
- width: $input-height-small;
384
- height: $input-height-small;
385
- line-height: $input-height-small;
184
+
185
+
186
+ // Form grid
187
+ //
188
+ // Special replacement for our grid system's `.row` for tighter form layouts.
189
+
190
+ .form-row {
191
+ display: flex;
192
+ flex-wrap: wrap;
193
+ margin-right: -5px;
194
+ margin-left: -5px;
195
+
196
+ > .col,
197
+ > [class*="col-"] {
198
+ padding-right: 5px;
199
+ padding-left: 5px;
200
+ }
386
201
  }
387
202
 
388
- // Feedback states
389
- .has-success {
390
- @include form-control-validation($state-success-text, $state-success-text, $state-success-bg);
203
+
204
+ // Checkboxes and radios
205
+ //
206
+ // Indent the labels to position radios/checkboxes as hanging controls.
207
+
208
+ .form-check {
209
+ position: relative;
210
+ display: block;
211
+ padding-left: $form-check-input-gutter;
391
212
  }
392
- .has-warning {
393
- @include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg);
213
+
214
+ .form-check-input {
215
+ position: absolute;
216
+ margin-top: $form-check-input-margin-y;
217
+ margin-left: -$form-check-input-gutter;
218
+
219
+ &:disabled ~ .form-check-label {
220
+ color: $text-muted;
221
+ }
394
222
  }
395
- .has-error {
396
- @include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg);
223
+
224
+ .form-check-label {
225
+ margin-bottom: 0; // Override default `<label>` bottom margin
397
226
  }
398
227
 
399
- // Reposition feedback icon if input has visible label above
400
- .has-feedback label {
228
+ .form-check-inline {
229
+ display: inline-flex;
230
+ align-items: center;
231
+ padding-left: 0; // Override base .form-check
232
+ margin-right: $form-check-inline-margin-x;
401
233
 
402
- & ~ .form-control-feedback {
403
- top: ($line-height-computed + 5); // Height of the `label` and its margin
404
- }
405
- &.sr-only ~ .form-control-feedback {
406
- top: 0;
234
+ // Undo .form-check-input defaults and add some `margin-right`.
235
+ .form-check-input {
236
+ position: static;
237
+ margin-top: 0;
238
+ margin-right: $form-check-inline-input-margin-x;
239
+ margin-left: 0;
407
240
  }
408
241
  }
409
242
 
410
243
 
411
- // Help text
244
+ // Form validation
412
245
  //
413
- // Apply to any element you wish to create light text for placement immediately
414
- // below a form control. Use for general help, formatting, or instructional text.
415
-
416
- .help-block {
417
- display: block; // account for any element using help-block
418
- margin-top: 5px;
419
- margin-bottom: 10px;
420
- color: lighten($text-color, 25%); // lighten the text some for contrast
421
- }
246
+ // Provide feedback to users when form field values are valid or invalid. Works
247
+ // primarily for client-side validation via scoped `:invalid` and `:valid`
248
+ // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
249
+ // server side validation.
422
250
 
251
+ @include form-validation-state("valid", $form-feedback-valid-color);
252
+ @include form-validation-state("invalid", $form-feedback-invalid-color);
423
253
 
424
254
  // Inline forms
425
255
  //
@@ -429,22 +259,38 @@ input[type="checkbox"] {
429
259
  //
430
260
  // Requires wrapping inputs and labels with `.form-group` for proper display of
431
261
  // default HTML form controls and our custom form controls (e.g., input groups).
432
- //
433
- // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
434
262
 
435
- // [converter] extracted from `.form-inline` for libsass compatibility
436
- @mixin form-inline {
263
+ .form-inline {
264
+ display: flex;
265
+ flex-flow: row wrap;
266
+ align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
267
+
268
+ // Because we use flex, the initial sizing of checkboxes is collapsed and
269
+ // doesn't occupy the full-width (which is what we want for xs grid tier),
270
+ // so we force that here.
271
+ .form-check {
272
+ width: 100%;
273
+ }
437
274
 
438
275
  // Kick in the inline
439
- @media (min-width: $screen-sm-min) {
276
+ @include media-breakpoint-up(sm) {
277
+ label {
278
+ display: flex;
279
+ align-items: center;
280
+ justify-content: center;
281
+ margin-bottom: 0;
282
+ }
283
+
440
284
  // Inline-block all the things for "inline"
441
285
  .form-group {
442
- display: inline-block;
286
+ display: flex;
287
+ flex: 0 0 auto;
288
+ flex-flow: row wrap;
289
+ align-items: center;
443
290
  margin-bottom: 0;
444
- vertical-align: middle;
445
291
  }
446
292
 
447
- // In navbar-form, allow folks to *not* use `.form-group`
293
+ // Allow folks to *not* use `.form-group`
448
294
  .form-control {
449
295
  display: inline-block;
450
296
  width: auto; // Prevent labels from stacking above inputs in `.form-group`
@@ -452,127 +298,36 @@ input[type="checkbox"] {
452
298
  }
453
299
 
454
300
  // Make static controls behave like regular ones
455
- .form-control-static {
301
+ .form-control-plaintext {
456
302
  display: inline-block;
457
303
  }
458
304
 
459
305
  .input-group {
460
- display: inline-table;
461
- vertical-align: middle;
462
-
463
- .input-group-addon,
464
- .input-group-btn,
465
- .form-control {
466
- width: auto;
467
- }
468
- }
469
-
470
- // Input groups need that 100% width though
471
- .input-group > .form-control {
472
- width: 100%;
473
- }
474
-
475
- .control-label {
476
- margin-bottom: 0;
477
- vertical-align: middle;
306
+ width: auto;
478
307
  }
479
308
 
480
309
  // Remove default margin on radios/checkboxes that were used for stacking, and
481
310
  // then undo the floating of radios and checkboxes to match.
482
- .radio,
483
- .checkbox {
484
- display: inline-block;
485
- margin-top: 0;
486
- margin-bottom: 0;
487
- vertical-align: middle;
488
-
489
- label {
490
- padding-left: 0;
491
- }
311
+ .form-check {
312
+ display: flex;
313
+ align-items: center;
314
+ justify-content: center;
315
+ width: auto;
316
+ padding-left: 0;
492
317
  }
493
- .radio input[type="radio"],
494
- .checkbox input[type="checkbox"] {
318
+ .form-check-input {
495
319
  position: relative;
320
+ margin-top: 0;
321
+ margin-right: $form-check-input-margin-x;
496
322
  margin-left: 0;
497
323
  }
498
324
 
499
- // Re-override the feedback icon.
500
- .has-feedback .form-control-feedback {
501
- top: 0;
325
+ .custom-control {
326
+ align-items: center;
327
+ justify-content: center;
502
328
  }
503
- }
504
- }
505
- // [converter] extracted as `@mixin form-inline` for libsass compatibility
506
- .form-inline {
507
- @include form-inline;
508
- }
509
-
510
-
511
-
512
- // Horizontal forms
513
- //
514
- // Horizontal forms are built on grid classes and allow you to create forms with
515
- // labels on the left and inputs on the right.
516
-
517
- .form-horizontal {
518
-
519
- // Consistent vertical alignment of radios and checkboxes
520
- //
521
- // Labels also get some reset styles, but that is scoped to a media query below.
522
- .radio,
523
- .checkbox,
524
- .radio-inline,
525
- .checkbox-inline {
526
- margin-top: 0;
527
- margin-bottom: 0;
528
- padding-top: ($padding-base-vertical + 1); // Default padding plus a border
529
- }
530
- // Account for padding we're adding to ensure the alignment and of help text
531
- // and other content below items
532
- .radio,
533
- .checkbox {
534
- min-height: ($line-height-computed + ($padding-base-vertical + 1));
535
- }
536
-
537
- // Make form groups behave like rows
538
- .form-group {
539
- @include make-row;
540
- }
541
-
542
- // Reset spacing and right align labels, but scope to media queries so that
543
- // labels on narrow viewports stack the same as a default form example.
544
- @media (min-width: $screen-sm-min) {
545
- .control-label {
546
- text-align: right;
329
+ .custom-control-label {
547
330
  margin-bottom: 0;
548
- padding-top: ($padding-base-vertical + 1); // Default padding plus a border
549
- }
550
- }
551
-
552
- // Validation states
553
- //
554
- // Reposition the icon because it's now within a grid column and columns have
555
- // `position: relative;` on them. Also accounts for the grid gutter padding.
556
- .has-feedback .form-control-feedback {
557
- right: ($grid-gutter-width / 2);
558
- }
559
-
560
- // Form group sizes
561
- //
562
- // Quick utility class for applying `.input-lg` and `.input-sm` styles to the
563
- // inputs and labels within a `.form-group`.
564
- .form-group-lg {
565
- @media (min-width: $screen-sm-min) {
566
- .control-label {
567
- padding-top: (($padding-large-vertical * $line-height-large) + 1);
568
- }
569
- }
570
- }
571
- .form-group-sm {
572
- @media (min-width: $screen-sm-min) {
573
- .control-label {
574
- padding-top: ($padding-small-vertical + 1);
575
- }
576
331
  }
577
332
  }
578
333
  }