cm-admin 1.1.9 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/javascripts/cm_admin/scaffolds.js +6 -0
  4. data/app/assets/javascripts/cm_admin/shared_scaffolds.js +97 -81
  5. data/app/assets/stylesheets/cm_admin/base/form.scss +31 -225
  6. data/app/assets/stylesheets/cm_admin/base/navbar.scss +1 -1
  7. data/app/assets/stylesheets/cm_admin/base/scaffold.scss +8 -5
  8. data/app/assets/stylesheets/cm_admin/base/show.scss +15 -22
  9. data/app/assets/stylesheets/cm_admin/base/table.scss +6 -0
  10. data/app/assets/stylesheets/cm_admin/components/_buttons.scss +1 -1
  11. data/app/assets/stylesheets/cm_admin/components/_modal.scss +7 -30
  12. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_accordion.scss +158 -0
  13. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_alert.scss +68 -0
  14. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_badge.scss +38 -0
  15. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_breadcrumb.scss +40 -0
  16. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_button-group.scss +142 -0
  17. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_buttons.scss +207 -0
  18. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_card.scss +239 -0
  19. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_carousel.scss +244 -0
  20. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_close.scss +63 -0
  21. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_containers.scss +41 -0
  22. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_dropdown.scss +250 -0
  23. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_forms.scss +9 -0
  24. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_functions.scss +302 -0
  25. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_grid.scss +39 -0
  26. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_helpers.scss +12 -0
  27. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_images.scss +42 -0
  28. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_list-group.scss +197 -0
  29. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_maps.scss +174 -0
  30. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_mixins.scss +42 -0
  31. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_modal.scss +237 -0
  32. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_nav.scss +197 -0
  33. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_navbar.scss +289 -0
  34. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_offcanvas.scss +146 -0
  35. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_pagination.scss +109 -0
  36. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_placeholders.scss +51 -0
  37. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_popover.scss +196 -0
  38. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_progress.scss +68 -0
  39. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_reboot.scss +610 -0
  40. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_root.scss +184 -0
  41. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_spinners.scss +85 -0
  42. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_tables.scss +171 -0
  43. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_toasts.scss +73 -0
  44. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_tooltip.scss +119 -0
  45. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_transitions.scss +27 -0
  46. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_type.scss +106 -0
  47. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_utilities.scss +806 -0
  48. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_variables-dark.scss +85 -0
  49. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/_variables.scss +1745 -0
  50. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/bootstrap-grid.scss +62 -0
  51. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/bootstrap-reboot.scss +10 -0
  52. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/bootstrap-utilities.scss +19 -0
  53. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/bootstrap.scss +52 -0
  54. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_floating-labels.scss +95 -0
  55. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_form-check.scss +188 -0
  56. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_form-control.scss +214 -0
  57. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_form-range.scss +91 -0
  58. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_form-select.scss +80 -0
  59. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_form-text.scss +11 -0
  60. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_input-group.scss +132 -0
  61. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_labels.scss +36 -0
  62. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/forms/_validation.scss +12 -0
  63. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_clearfix.scss +3 -0
  64. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_color-bg.scss +7 -0
  65. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_colored-links.scss +30 -0
  66. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_focus-ring.scss +5 -0
  67. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_icon-link.scss +25 -0
  68. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_position.scss +36 -0
  69. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_ratio.scss +26 -0
  70. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_stacks.scss +15 -0
  71. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_stretched-link.scss +15 -0
  72. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_text-truncation.scss +7 -0
  73. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
  74. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/helpers/_vr.scss +8 -0
  75. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_alert.scss +18 -0
  76. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_backdrop.scss +14 -0
  77. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_banner.scss +7 -0
  78. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_border-radius.scss +78 -0
  79. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_box-shadow.scss +18 -0
  80. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_breakpoints.scss +127 -0
  81. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_buttons.scss +70 -0
  82. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_caret.scss +69 -0
  83. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_clearfix.scss +9 -0
  84. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_color-mode.scss +21 -0
  85. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_color-scheme.scss +7 -0
  86. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_container.scss +11 -0
  87. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_deprecate.scss +10 -0
  88. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_forms.scss +153 -0
  89. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_gradients.scss +47 -0
  90. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_grid.scss +151 -0
  91. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_image.scss +16 -0
  92. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_list-group.scss +26 -0
  93. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_lists.scss +7 -0
  94. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_pagination.scss +10 -0
  95. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_reset-text.scss +17 -0
  96. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_resize.scss +6 -0
  97. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_table-variants.scss +24 -0
  98. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  99. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_transition.scss +26 -0
  100. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_utilities.scss +97 -0
  101. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/mixins/_visually-hidden.scss +33 -0
  102. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/jasmine.js +16 -0
  103. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_color-modes.test.scss +69 -0
  104. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_media-query-color-mode-full.test.scss +8 -0
  105. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/mixins/_utilities.test.scss +393 -0
  106. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/sass-true/register.js +14 -0
  107. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/sass-true/runner.js +17 -0
  108. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/tests/utilities/_api.test.scss +75 -0
  109. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/utilities/_api.scss +47 -0
  110. data/app/assets/stylesheets/cm_admin/dependency/bootstrap/scss/vendor/_rfs.scss +348 -0
  111. data/app/controllers/cm_admin/resource_controller.rb +22 -5
  112. data/app/helpers/cm_admin/application_helper.rb +4 -4
  113. data/app/views/cm_admin/main/_actions_dropdown.html.slim +2 -2
  114. data/app/views/cm_admin/main/_custom_action_modal_form.html.slim +6 -0
  115. data/app/views/cm_admin/main/_nested_fields.html.slim +36 -17
  116. data/app/views/cm_admin/main/_nested_table_form.html.slim +17 -8
  117. data/app/views/cm_admin/main/_nested_table_section.html.slim +17 -0
  118. data/app/views/cm_admin/main/_show_section.html.slim +10 -0
  119. data/app/views/cm_admin/main/_tabs.html.slim +1 -1
  120. data/app/views/cm_admin/main/_top_navbar.html.slim +9 -3
  121. data/app/views/cm_admin/main/associated_show.html.slim +5 -4
  122. data/app/views/cm_admin/main/edit.html.slim +18 -18
  123. data/app/views/cm_admin/main/history.html.slim +3 -3
  124. data/app/views/cm_admin/main/import_form.html.slim +1 -1
  125. data/app/views/cm_admin/main/new.html.slim +17 -17
  126. data/app/views/cm_admin/main/show.html.slim +10 -10
  127. data/app/views/layouts/_custom_action_modal.html.slim +11 -0
  128. data/app/views/layouts/_custom_action_modals.html.slim +13 -9
  129. data/app/views/layouts/_destroy_action_modal.html.slim +16 -0
  130. data/app/views/layouts/cm_admin.html.slim +5 -5
  131. data/config/routes.rb +1 -3
  132. data/lib/cm_admin/model.rb +1 -0
  133. data/lib/cm_admin/models/custom_action.rb +6 -0
  134. data/lib/cm_admin/models/dsl_method.rb +9 -4
  135. data/lib/cm_admin/models/field.rb +2 -1
  136. data/lib/cm_admin/models/form_field.rb +2 -1
  137. data/lib/cm_admin/models/row.rb +40 -0
  138. data/lib/cm_admin/models/section.rb +20 -3
  139. data/lib/cm_admin/version.rb +1 -1
  140. data/lib/cm_admin/view_helpers/field_display_helper.rb +3 -3
  141. data/lib/cm_admin/view_helpers/form_field_helper.rb +40 -14
  142. data/lib/cm_admin/view_helpers/form_helper.rb +59 -22
  143. data/lib/cm_admin/view_helpers/page_info_helper.rb +4 -4
  144. data/lib/cm_admin/view_helpers.rb +1 -1
  145. metadata +107 -2
@@ -0,0 +1,610 @@
1
+ // stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
2
+
3
+
4
+ // Reboot
5
+ //
6
+ // Normalization of HTML elements, manually forked from Normalize.css to remove
7
+ // styles targeting irrelevant browsers while applying new styles.
8
+ //
9
+ // Normalize is licensed MIT. https://github.com/necolas/normalize.css
10
+
11
+
12
+ // Document
13
+ //
14
+ // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
15
+
16
+ *,
17
+ *::before,
18
+ *::after {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+
23
+ // Root
24
+ //
25
+ // Ability to the value of the root font sizes, affecting the value of `rem`.
26
+ // null by default, thus nothing is generated.
27
+
28
+ :root {
29
+ @if $font-size-root != null {
30
+ @include font-size(var(--#{$prefix}root-font-size));
31
+ }
32
+
33
+ @if $enable-smooth-scroll {
34
+ @media (prefers-reduced-motion: no-preference) {
35
+ scroll-behavior: smooth;
36
+ }
37
+ }
38
+ }
39
+
40
+
41
+ // Body
42
+ //
43
+ // 1. Remove the margin in all browsers.
44
+ // 2. As a best practice, apply a default `background-color`.
45
+ // 3. Prevent adjustments of font size after orientation changes in iOS.
46
+ // 4. Change the default tap highlight to be completely transparent in iOS.
47
+
48
+ // scss-docs-start reboot-body-rules
49
+ body {
50
+ margin: 0; // 1
51
+ font-family: var(--#{$prefix}body-font-family);
52
+ @include font-size(var(--#{$prefix}body-font-size));
53
+ font-weight: var(--#{$prefix}body-font-weight);
54
+ line-height: var(--#{$prefix}body-line-height);
55
+ color: var(--#{$prefix}body-color);
56
+ text-align: var(--#{$prefix}body-text-align);
57
+ background-color: var(--#{$prefix}body-bg); // 2
58
+ -webkit-text-size-adjust: 100%; // 3
59
+ -webkit-tap-highlight-color: rgba($black, 0); // 4
60
+ }
61
+ // scss-docs-end reboot-body-rules
62
+
63
+
64
+ // Content grouping
65
+ //
66
+ // 1. Reset Firefox's gray color
67
+
68
+ hr {
69
+ margin: $hr-margin-y 0;
70
+ color: $hr-color; // 1
71
+ border: 0;
72
+ border-top: $hr-border-width solid $hr-border-color;
73
+ opacity: $hr-opacity;
74
+ }
75
+
76
+
77
+ // Typography
78
+ //
79
+ // 1. Remove top margins from headings
80
+ // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
81
+ // margin for easier control within type scales as it avoids margin collapsing.
82
+
83
+ %heading {
84
+ margin-top: 0; // 1
85
+ margin-bottom: $headings-margin-bottom;
86
+ font-family: $headings-font-family;
87
+ font-style: $headings-font-style;
88
+ font-weight: $headings-font-weight;
89
+ line-height: $headings-line-height;
90
+ color: var(--#{$prefix}heading-color);
91
+ }
92
+
93
+ h1 {
94
+ @extend %heading;
95
+ @include font-size($h1-font-size);
96
+ }
97
+
98
+ h2 {
99
+ @extend %heading;
100
+ @include font-size($h2-font-size);
101
+ }
102
+
103
+ h3 {
104
+ @extend %heading;
105
+ @include font-size($h3-font-size);
106
+ }
107
+
108
+ h4 {
109
+ @extend %heading;
110
+ @include font-size($h4-font-size);
111
+ }
112
+
113
+ h5 {
114
+ @extend %heading;
115
+ @include font-size($h5-font-size);
116
+ }
117
+
118
+ h6 {
119
+ @extend %heading;
120
+ @include font-size($h6-font-size);
121
+ }
122
+
123
+
124
+ // Reset margins on paragraphs
125
+ //
126
+ // Similarly, the top margin on `<p>`s get reset. However, we also reset the
127
+ // bottom margin to use `rem` units instead of `em`.
128
+
129
+ p {
130
+ margin-top: 0;
131
+ margin-bottom: $paragraph-margin-bottom;
132
+ }
133
+
134
+
135
+ // Abbreviations
136
+ //
137
+ // 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
138
+ // 2. Add explicit cursor to indicate changed behavior.
139
+ // 3. Prevent the text-decoration to be skipped.
140
+
141
+ abbr[title] {
142
+ text-decoration: underline dotted; // 1
143
+ cursor: help; // 2
144
+ text-decoration-skip-ink: none; // 3
145
+ }
146
+
147
+
148
+ // Address
149
+
150
+ address {
151
+ margin-bottom: 1rem;
152
+ font-style: normal;
153
+ line-height: inherit;
154
+ }
155
+
156
+
157
+ // Lists
158
+
159
+ ol,
160
+ ul {
161
+ padding-left: 2rem;
162
+ }
163
+
164
+ ol,
165
+ ul,
166
+ dl {
167
+ margin-top: 0;
168
+ margin-bottom: 1rem;
169
+ }
170
+
171
+ ol ol,
172
+ ul ul,
173
+ ol ul,
174
+ ul ol {
175
+ margin-bottom: 0;
176
+ }
177
+
178
+ dt {
179
+ font-weight: $dt-font-weight;
180
+ }
181
+
182
+ // 1. Undo browser default
183
+
184
+ dd {
185
+ margin-bottom: .5rem;
186
+ margin-left: 0; // 1
187
+ }
188
+
189
+
190
+ // Blockquote
191
+
192
+ blockquote {
193
+ margin: 0 0 1rem;
194
+ }
195
+
196
+
197
+ // Strong
198
+ //
199
+ // Add the correct font weight in Chrome, Edge, and Safari
200
+
201
+ b,
202
+ strong {
203
+ font-weight: $font-weight-bolder;
204
+ }
205
+
206
+
207
+ // Small
208
+ //
209
+ // Add the correct font size in all browsers
210
+
211
+ small {
212
+ @include font-size($small-font-size);
213
+ }
214
+
215
+
216
+ // Mark
217
+
218
+ mark {
219
+ padding: $mark-padding;
220
+ background-color: var(--#{$prefix}highlight-bg);
221
+ }
222
+
223
+
224
+ // Sub and Sup
225
+ //
226
+ // Prevent `sub` and `sup` elements from affecting the line height in
227
+ // all browsers.
228
+
229
+ sub,
230
+ sup {
231
+ position: relative;
232
+ @include font-size($sub-sup-font-size);
233
+ line-height: 0;
234
+ vertical-align: baseline;
235
+ }
236
+
237
+ sub { bottom: -.25em; }
238
+ sup { top: -.5em; }
239
+
240
+
241
+ // Links
242
+
243
+ a {
244
+ color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));
245
+ text-decoration: $link-decoration;
246
+
247
+ &:hover {
248
+ --#{$prefix}link-color-rgb: var(--#{$prefix}link-hover-color-rgb);
249
+ text-decoration: $link-hover-decoration;
250
+ }
251
+ }
252
+
253
+ // And undo these styles for placeholder links/named anchors (without href).
254
+ // It would be more straightforward to just use a[href] in previous block, but that
255
+ // causes specificity issues in many other styles that are too complex to fix.
256
+ // See https://github.com/twbs/bootstrap/issues/19402
257
+
258
+ a:not([href]):not([class]) {
259
+ &,
260
+ &:hover {
261
+ color: inherit;
262
+ text-decoration: none;
263
+ }
264
+ }
265
+
266
+
267
+ // Code
268
+
269
+ pre,
270
+ code,
271
+ kbd,
272
+ samp {
273
+ font-family: $font-family-code;
274
+ @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
275
+ }
276
+
277
+ // 1. Remove browser default top margin
278
+ // 2. Reset browser default of `1em` to use `rem`s
279
+ // 3. Don't allow content to break outside
280
+
281
+ pre {
282
+ display: block;
283
+ margin-top: 0; // 1
284
+ margin-bottom: 1rem; // 2
285
+ overflow: auto; // 3
286
+ @include font-size($code-font-size);
287
+ color: $pre-color;
288
+
289
+ // Account for some code outputs that place code tags in pre tags
290
+ code {
291
+ @include font-size(inherit);
292
+ color: inherit;
293
+ word-break: normal;
294
+ }
295
+ }
296
+
297
+ code {
298
+ @include font-size($code-font-size);
299
+ color: var(--#{$prefix}code-color);
300
+ word-wrap: break-word;
301
+
302
+ // Streamline the style when inside anchors to avoid broken underline and more
303
+ a > & {
304
+ color: inherit;
305
+ }
306
+ }
307
+
308
+ kbd {
309
+ padding: $kbd-padding-y $kbd-padding-x;
310
+ @include font-size($kbd-font-size);
311
+ color: $kbd-color;
312
+ background-color: $kbd-bg;
313
+ @include border-radius($border-radius-sm);
314
+
315
+ kbd {
316
+ padding: 0;
317
+ @include font-size(1em);
318
+ font-weight: $nested-kbd-font-weight;
319
+ }
320
+ }
321
+
322
+
323
+ // Figures
324
+ //
325
+ // Apply a consistent margin strategy (matches our type styles).
326
+
327
+ figure {
328
+ margin: 0 0 1rem;
329
+ }
330
+
331
+
332
+ // Images and content
333
+
334
+ img,
335
+ svg {
336
+ vertical-align: middle;
337
+ }
338
+
339
+
340
+ // Tables
341
+ //
342
+ // Prevent double borders
343
+
344
+ table {
345
+ caption-side: bottom;
346
+ border-collapse: collapse;
347
+ }
348
+
349
+ caption {
350
+ padding-top: $table-cell-padding-y;
351
+ padding-bottom: $table-cell-padding-y;
352
+ color: $table-caption-color;
353
+ text-align: left;
354
+ }
355
+
356
+ // 1. Removes font-weight bold by inheriting
357
+ // 2. Matches default `<td>` alignment by inheriting `text-align`.
358
+ // 3. Fix alignment for Safari
359
+
360
+ th {
361
+ font-weight: $table-th-font-weight; // 1
362
+ text-align: inherit; // 2
363
+ text-align: -webkit-match-parent; // 3
364
+ }
365
+
366
+ thead,
367
+ tbody,
368
+ tfoot,
369
+ tr,
370
+ td,
371
+ th {
372
+ border-color: inherit;
373
+ border-style: solid;
374
+ border-width: 0;
375
+ }
376
+
377
+
378
+ // Forms
379
+ //
380
+ // 1. Allow labels to use `margin` for spacing.
381
+
382
+ label {
383
+ display: inline-block; // 1
384
+ }
385
+
386
+ // Remove the default `border-radius` that macOS Chrome adds.
387
+ // See https://github.com/twbs/bootstrap/issues/24093
388
+
389
+ button {
390
+ // stylelint-disable-next-line property-disallowed-list
391
+ border-radius: 0;
392
+ }
393
+
394
+ // Explicitly remove focus outline in Chromium when it shouldn't be
395
+ // visible (e.g. as result of mouse click or touch tap). It already
396
+ // should be doing this automatically, but seems to currently be
397
+ // confused and applies its very visible two-tone outline anyway.
398
+
399
+ button:focus:not(:focus-visible) {
400
+ outline: 0;
401
+ }
402
+
403
+ // 1. Remove the margin in Firefox and Safari
404
+
405
+ input,
406
+ button,
407
+ select,
408
+ optgroup,
409
+ textarea {
410
+ margin: 0; // 1
411
+ font-family: inherit;
412
+ @include font-size(inherit);
413
+ line-height: inherit;
414
+ }
415
+
416
+ // Remove the inheritance of text transform in Firefox
417
+ button,
418
+ select {
419
+ text-transform: none;
420
+ }
421
+ // Set the cursor for non-`<button>` buttons
422
+ //
423
+ // Details at https://github.com/twbs/bootstrap/pull/30562
424
+ [role="button"] {
425
+ cursor: pointer;
426
+ }
427
+
428
+ select {
429
+ // Remove the inheritance of word-wrap in Safari.
430
+ // See https://github.com/twbs/bootstrap/issues/24990
431
+ word-wrap: normal;
432
+
433
+ // Undo the opacity change from Chrome
434
+ &:disabled {
435
+ opacity: 1;
436
+ }
437
+ }
438
+
439
+ // Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
440
+ // See https://stackoverflow.com/a/54997118
441
+
442
+ [list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="time"])::-webkit-calendar-picker-indicator {
443
+ display: none !important;
444
+ }
445
+
446
+ // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
447
+ // controls in Android 4.
448
+ // 2. Correct the inability to style clickable types in iOS and Safari.
449
+ // 3. Opinionated: add "hand" cursor to non-disabled button elements.
450
+
451
+ button,
452
+ [type="button"], // 1
453
+ [type="reset"],
454
+ [type="submit"] {
455
+ -webkit-appearance: button; // 2
456
+
457
+ @if $enable-button-pointers {
458
+ &:not(:disabled) {
459
+ cursor: pointer; // 3
460
+ }
461
+ }
462
+ }
463
+
464
+ // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
465
+
466
+ ::-moz-focus-inner {
467
+ padding: 0;
468
+ border-style: none;
469
+ }
470
+
471
+ // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
472
+
473
+ textarea {
474
+ resize: vertical; // 1
475
+ }
476
+
477
+ // 1. Browsers set a default `min-width: min-content;` on fieldsets,
478
+ // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
479
+ // So we reset that to ensure fieldsets behave more like a standard block element.
480
+ // See https://github.com/twbs/bootstrap/issues/12359
481
+ // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
482
+ // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
483
+
484
+ fieldset {
485
+ min-width: 0; // 1
486
+ padding: 0; // 2
487
+ margin: 0; // 2
488
+ border: 0; // 2
489
+ }
490
+
491
+ // 1. By using `float: left`, the legend will behave like a block element.
492
+ // This way the border of a fieldset wraps around the legend if present.
493
+ // 2. Fix wrapping bug.
494
+ // See https://github.com/twbs/bootstrap/issues/29712
495
+
496
+ legend {
497
+ float: left; // 1
498
+ width: 100%;
499
+ padding: 0;
500
+ margin-bottom: $legend-margin-bottom;
501
+ @include font-size($legend-font-size);
502
+ font-weight: $legend-font-weight;
503
+ line-height: inherit;
504
+
505
+ + * {
506
+ clear: left; // 2
507
+ }
508
+ }
509
+
510
+ // Fix height of inputs with a type of datetime-local, date, month, week, or time
511
+ // See https://github.com/twbs/bootstrap/issues/18842
512
+
513
+ ::-webkit-datetime-edit-fields-wrapper,
514
+ ::-webkit-datetime-edit-text,
515
+ ::-webkit-datetime-edit-minute,
516
+ ::-webkit-datetime-edit-hour-field,
517
+ ::-webkit-datetime-edit-day-field,
518
+ ::-webkit-datetime-edit-month-field,
519
+ ::-webkit-datetime-edit-year-field {
520
+ padding: 0;
521
+ }
522
+
523
+ ::-webkit-inner-spin-button {
524
+ height: auto;
525
+ }
526
+
527
+ // 1. This overrides the extra rounded corners on search inputs in iOS so that our
528
+ // `.form-control` class can properly style them. Note that this cannot simply
529
+ // be added to `.form-control` as it's not specific enough. For details, see
530
+ // https://github.com/twbs/bootstrap/issues/11586.
531
+ // 2. Correct the outline style in Safari.
532
+
533
+ [type="search"] {
534
+ -webkit-appearance: textfield; // 1
535
+ outline-offset: -2px; // 2
536
+ }
537
+
538
+ // 1. A few input types should stay LTR
539
+ // See https://rtlstyling.com/posts/rtl-styling#form-inputs
540
+ // 2. RTL only output
541
+ // See https://rtlcss.com/learn/usage-guide/control-directives/#raw
542
+
543
+ /* rtl:raw:
544
+ [type="tel"],
545
+ [type="url"],
546
+ [type="email"],
547
+ [type="number"] {
548
+ direction: ltr;
549
+ }
550
+ */
551
+
552
+ // Remove the inner padding in Chrome and Safari on macOS.
553
+
554
+ ::-webkit-search-decoration {
555
+ -webkit-appearance: none;
556
+ }
557
+
558
+ // Remove padding around color pickers in webkit browsers
559
+
560
+ ::-webkit-color-swatch-wrapper {
561
+ padding: 0;
562
+ }
563
+
564
+
565
+ // 1. Inherit font family and line height for file input buttons
566
+ // 2. Correct the inability to style clickable types in iOS and Safari.
567
+
568
+ ::file-selector-button {
569
+ font: inherit; // 1
570
+ -webkit-appearance: button; // 2
571
+ }
572
+
573
+ // Correct element displays
574
+
575
+ output {
576
+ display: inline-block;
577
+ }
578
+
579
+ // Remove border from iframe
580
+
581
+ iframe {
582
+ border: 0;
583
+ }
584
+
585
+ // Summary
586
+ //
587
+ // 1. Add the correct display in all browsers
588
+
589
+ summary {
590
+ display: list-item; // 1
591
+ cursor: pointer;
592
+ }
593
+
594
+
595
+ // Progress
596
+ //
597
+ // Add the correct vertical alignment in Chrome, Firefox, and Opera.
598
+
599
+ progress {
600
+ vertical-align: baseline;
601
+ }
602
+
603
+
604
+ // Hidden attribute
605
+ //
606
+ // Always hide an element with the `hidden` HTML attribute.
607
+
608
+ [hidden] {
609
+ display: none !important;
610
+ }