@stackoverflow/stacks 3.0.0-beta.3 → 3.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/controllers.d.ts +0 -2
  2. package/dist/css/stacks.css +14245 -15086
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +0 -364
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/atomic/backgrounds.less +67 -0
  7. package/lib/atomic/border-radius.less +38 -0
  8. package/lib/atomic/borders.less +73 -0
  9. package/lib/atomic/box-shadow.less +29 -0
  10. package/lib/atomic/box-sizing.less +3 -0
  11. package/lib/atomic/current-color.less +2 -0
  12. package/lib/atomic/cursors.less +8 -0
  13. package/lib/atomic/display.less +15 -0
  14. package/lib/atomic/flex.less +6 -34
  15. package/lib/atomic/floats.less +20 -0
  16. package/lib/atomic/gap.less +2 -0
  17. package/lib/atomic/grid.less +2 -0
  18. package/lib/atomic/height.less +22 -0
  19. package/lib/atomic/interactivity.less +45 -0
  20. package/lib/atomic/lists.less +29 -0
  21. package/lib/atomic/margin.less +48 -0
  22. package/lib/atomic/object-fit.less +9 -0
  23. package/lib/atomic/opacity.less +54 -0
  24. package/lib/atomic/outline.less +11 -0
  25. package/lib/atomic/overflow.less +17 -0
  26. package/lib/atomic/padding.less +12 -0
  27. package/lib/atomic/positioning.less +41 -0
  28. package/lib/atomic/sizing.less +51 -0
  29. package/lib/atomic/transitions.less +20 -0
  30. package/lib/atomic/truncation.less +58 -0
  31. package/lib/atomic/typography.less +71 -137
  32. package/lib/atomic/vertical-alignment.less +9 -0
  33. package/lib/atomic/visibility.less +18 -0
  34. package/lib/atomic/width.less +27 -0
  35. package/lib/atomic/z-index.less +12 -0
  36. package/lib/base/body.less +2 -4
  37. package/lib/base/configuration-static.less +3 -3
  38. package/lib/base/internal.less +3 -5
  39. package/lib/base/reset-normalize.less +3 -3
  40. package/lib/components/activity-indicator/activity-indicator.less +4 -20
  41. package/lib/components/anchor/anchor.less +28 -39
  42. package/lib/components/avatar/avatar.less +20 -19
  43. package/lib/components/badge/badge.less +227 -167
  44. package/lib/components/banner/banner.less +12 -11
  45. package/lib/components/bling/bling.less +47 -10
  46. package/lib/components/button/button.less +300 -380
  47. package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
  48. package/lib/components/code-block/code-block.fixtures.ts +2 -2
  49. package/lib/components/code-block/code-block.less +2 -3
  50. package/lib/components/description/description.less +17 -2
  51. package/lib/components/empty-state/empty-state.less +17 -6
  52. package/lib/components/form-group/form-group.less +38 -0
  53. package/lib/components/input-fill/input-fill.less +3 -3
  54. package/lib/components/input-icon/input-icon.less +3 -3
  55. package/lib/components/input-message/input-message.less +1 -0
  56. package/lib/components/input_textarea/input_textarea.less +71 -58
  57. package/lib/components/label/label.less +12 -56
  58. package/lib/components/link/link.less +44 -98
  59. package/lib/components/loader/loader.less +88 -0
  60. package/lib/components/menu/menu.less +89 -19
  61. package/lib/components/modal/modal.less +10 -10
  62. package/lib/components/navigation/navigation.less +77 -42
  63. package/lib/components/notice/notice.less +90 -75
  64. package/lib/components/pagination/pagination.less +50 -42
  65. package/lib/components/popover/popover.less +9 -11
  66. package/lib/components/post-summary/post-summary.less +225 -385
  67. package/lib/components/prose/prose.less +49 -35
  68. package/lib/components/select/select.less +46 -41
  69. package/lib/components/sidebar-widget/sidebar-widget.less +26 -196
  70. package/lib/components/table/table.less +48 -22
  71. package/lib/components/tag/tag.less +25 -6
  72. package/lib/components/toast/toast.less +4 -2
  73. package/lib/components/toggle-switch/toggle-switch.less +15 -19
  74. package/lib/components/user-card/user-card.less +129 -92
  75. package/lib/components/vote/vote.less +134 -0
  76. package/lib/controllers.ts +0 -2
  77. package/lib/exports/color-sets.less +108 -81
  78. package/lib/exports/constants-helpers.less +9 -13
  79. package/lib/exports/constants-type.less +18 -36
  80. package/lib/exports/mixins.less +92 -272
  81. package/lib/index.ts +0 -4
  82. package/lib/stacks-static.less +44 -30
  83. package/lib/test/visual-test-utils.ts +42 -10
  84. package/lib/tsconfig.json +1 -1
  85. package/package.json +1 -1
  86. package/dist/components/expandable/expandable.d.ts +0 -17
  87. package/dist/components/uploader/uploader.d.ts +0 -48
  88. package/lib/atomic/border.less +0 -121
  89. package/lib/atomic/misc.less +0 -374
  90. package/lib/atomic/spacing.less +0 -98
  91. package/lib/atomic/width-height.less +0 -194
  92. package/lib/components/block-link/block-link.less +0 -82
  93. package/lib/components/breadcrumbs/breadcrumbs.less +0 -41
  94. package/lib/components/button-group/button-group.less +0 -81
  95. package/lib/components/card/card.less +0 -37
  96. package/lib/components/check-control/check-control.less +0 -17
  97. package/lib/components/check-group/check-group.less +0 -19
  98. package/lib/components/expandable/expandable.less +0 -119
  99. package/lib/components/expandable/expandable.ts +0 -238
  100. package/lib/components/link-preview/link-preview.less +0 -148
  101. package/lib/components/page-title/page-title.less +0 -51
  102. package/lib/components/progress-bar/progress-bar.less +0 -292
  103. package/lib/components/skeleton/skeleton.less +0 -73
  104. package/lib/components/spinner/spinner.less +0 -103
  105. package/lib/components/topbar/topbar.less +0 -553
  106. package/lib/components/uploader/uploader.less +0 -205
  107. package/lib/components/uploader/uploader.ts +0 -207
  108. package/lib/exports/spacing-mixins.less +0 -67
@@ -1,194 +0,0 @@
1
- //
2
- // STACK OVERFLOW
3
- // WIDTH & HEIGHT
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // • WIDTH
10
- // • PERCENTAGE
11
- // • STATIC
12
- // • MAX-WIDTH
13
- // • MIN-WIDTH
14
- // • HEIGHT
15
- // • PERCENTAGE
16
- // • STATIC
17
- // • MAX-HEIGHT
18
- // • MIN-HEIGHT
19
- //
20
- // ============================================================================
21
- // $ WIDTH
22
- // ----------------------------------------------------------------------------
23
- // $$ PERCENTAGE AND VIEWPORT UNITS
24
- .w0 { width: 0 !important; }
25
- .w10 { width: 10% !important; }
26
- .w20 { width: 20% !important; }
27
- #stacks-internals #responsify('.w25', { width: 25% !important; });
28
- .w30 { width: 30% !important; }
29
- #stacks-internals #responsify('.w33', { width: 33.33333% !important; });
30
- .w40 { width: 40% !important; }
31
- #stacks-internals #responsify('.w50', { width: 50% !important; });
32
- .w60 { width: 60% !important; }
33
- #stacks-internals #responsify('.w66', { width: 66.66667% !important; });
34
- .w70 { width: 70% !important; }
35
- #stacks-internals #responsify('.w75', { width: 75% !important; });
36
- .w80 { width: 80% !important; }
37
- .w90 { width: 90% !important; }
38
- #stacks-internals #responsify('.w100', { width: 100% !important; });
39
- #stacks-internals #responsify('.w-auto', { width: auto !important; });
40
- #stacks-internals #responsify('.w-screen', { width: 100vw !important; });
41
-
42
- // $$ STATIC
43
- .ws0,
44
- .w0 { width: 0 !important; }
45
- .ws1 { width: var(--s-step) !important; }
46
- .ws2 { width: calc(var(--s-step) * 2) !important; }
47
- .ws3 { width: calc(var(--s-step) * 3) !important; }
48
- .ws4 { width: calc(var(--s-step) * 4) !important; }
49
- .ws5 { width: calc(var(--s-step) * 5) !important; }
50
- .ws6 { width: calc(var(--s-step) * 6) !important; }
51
- .ws7 { width: calc(var(--s-step) * 7) !important; }
52
- .ws8 { width: calc(var(--s-step) * 8) !important; }
53
- .ws9 { width: calc(var(--s-step) * 9) !important; }
54
- .ws10 { width: calc(var(--s-step) * 10) !important; }
55
- .ws11 { width: calc(var(--s-step) * 11) !important; }
56
- .ws12 { width: var(--s-full) !important; }
57
-
58
- // $$ SPACING UNITS
59
- .w2 { width: var(--su-static2) !important; }
60
- .w4 { width: var(--su-static4) !important; }
61
- .w6 { width: var(--su-static6) !important; }
62
- .w8 { width: var(--su-static8) !important; }
63
- .w12 { width: var(--su-static12) !important; }
64
- .w16 { width: var(--su-static16) !important; }
65
- .w24 { width: var(--su-static24) !important; }
66
- .w32 { width: var(--su-static32) !important; }
67
- .w48 { width: var(--su-static48) !important; }
68
- .w64 { width: var(--su-static64) !important; }
69
- .w96 { width: var(--su-static96) !important; }
70
- .w128 { width: var(--su-static128) !important; }
71
-
72
- // ============================================================================
73
- // $ MAX-WIDTH
74
- // ----------------------------------------------------------------------------
75
- .wmx0 { max-width: 0 !important; }
76
- .wmx1 { max-width: var(--s-step) !important; }
77
- .wmx2 { max-width: calc(var(--s-step) * 2) !important; }
78
- .wmx25 { max-width: 25% !important; }
79
- .wmx3 { max-width: calc(var(--s-step) * 3) !important; }
80
- .wmx4 { max-width: calc(var(--s-step) * 4) !important; }
81
- .wmx5 { max-width: calc(var(--s-step) * 5) !important; }
82
- .wmx50 { max-width: 50% !important; }
83
- .wmx6 { max-width: calc(var(--s-step) * 6) !important; }
84
- .wmx7 { max-width: calc(var(--s-step) * 7) !important; }
85
- .wmx75 { max-width: 75% !important; }
86
- .wmx8 { max-width: calc(var(--s-step) * 8) !important; }
87
- .wmx9 { max-width: calc(var(--s-step) * 9) !important; }
88
- .wmx10 { max-width: calc(var(--s-step) * 10) !important; }
89
- .wmx11 { max-width: calc(var(--s-step) * 11) !important; }
90
- .wmx12 { max-width: var(--s-full) !important; }
91
- #stacks-internals #responsify('.wmx100', { max-width: 100% !important; });
92
- #stacks-internals #responsify('.wmx-initial', { max-width: initial !important; });
93
- #stacks-internals #responsify('.wmx-screen', { max-width: 100vw !important; });
94
-
95
- // ============================================================================
96
- // $ MIN-WIDTH
97
- // ----------------------------------------------------------------------------
98
- .wmn0 { min-width: 0 !important; }
99
- .wmn1 { min-width: var(--s-step) !important; }
100
- .wmn2 { min-width: calc(var(--s-step) * 2) !important; }
101
- .wmn25 { min-width: 25% !important; }
102
- .wmn3 { min-width: calc(var(--s-step) * 3) !important; }
103
- .wmn4 { min-width: calc(var(--s-step) * 4) !important; }
104
- .wmn5 { min-width: calc(var(--s-step) * 5) !important; }
105
- .wmn50 { min-width: 50% !important; }
106
- .wmn6 { min-width: calc(var(--s-step) * 6) !important; }
107
- .wmn7 { min-width: calc(var(--s-step) * 7) !important; }
108
- .wmn75 { min-width: 75% !important; }
109
- .wmn8 { min-width: calc(var(--s-step) * 8) !important; }
110
- .wmn9 { min-width: calc(var(--s-step) * 9) !important; }
111
- .wmn10 { min-width: calc(var(--s-step) * 10) !important; }
112
- .wmn11 { min-width: calc(var(--s-step) * 11) !important; }
113
- .wmn12 { min-width: var(--s-full) !important; }
114
- #stacks-internals #responsify('.wmn100', { min-width: 100% !important; });
115
- #stacks-internals #responsify('.wmn-initial', { min-width: initial !important; });
116
-
117
- // ============================================================================
118
- // $ HEIGHT
119
- // ----------------------------------------------------------------------------
120
- // $$ PERCENTAGE AND VIEWPORT UNITS
121
- .h0 { height: 0 !important; }
122
- #stacks-internals #responsify('.h100', { height: 100% !important; });
123
- #stacks-internals #responsify('.h-auto', { height: auto !important; });
124
- #stacks-internals #responsify('.h-screen', { height: 100vh !important; });
125
-
126
- // $$ STATIC
127
- .hs0,
128
- .h0 { height: 0 !important; }
129
- .hs1 { height: var(--s-step) !important; }
130
- .hs2 { height: calc(var(--s-step) * 2) !important; }
131
- .hs3 { height: calc(var(--s-step) * 3) !important; }
132
- .hs4 { height: calc(var(--s-step) * 4) !important; }
133
- .hs5 { height: calc(var(--s-step) * 5) !important; }
134
- .hs6 { height: calc(var(--s-step) * 6) !important; }
135
- .hs7 { height: calc(var(--s-step) * 7) !important; }
136
- .hs8 { height: calc(var(--s-step) * 8) !important; }
137
- .hs9 { height: calc(var(--s-step) * 9) !important; }
138
- .hs10 { height: calc(var(--s-step) * 10) !important; }
139
- .hs11 { height: calc(var(--s-step) * 11) !important; }
140
- .hs12 { height: var(--s-full) !important; }
141
-
142
- // $$ SPACING UNITS
143
- .h2 { height: var(--su-static2) !important; }
144
- .h4 { height: var(--su-static4) !important; }
145
- .h6 { height: var(--su-static6) !important; }
146
- .h8 { height: var(--su-static8) !important; }
147
- .h12 { height: var(--su-static12) !important; }
148
- .h16 { height: var(--su-static16) !important; }
149
- .h24 { height: var(--su-static24) !important; }
150
- .h32 { height: var(--su-static32) !important; }
151
- .h48 { height: var(--su-static48) !important; }
152
- .h64 { height: var(--su-static64) !important; }
153
- .h96 { height: var(--su-static96) !important; }
154
- .h128 { height: var(--su-static128) !important; }
155
-
156
- // ============================================================================
157
- // $ MAX-HEIGHT
158
- // ----------------------------------------------------------------------------
159
- .hmx0 { max-height: 0 !important; }
160
- .hmx1 { max-height: var(--s-step) !important; }
161
- .hmx2 { max-height: calc(var(--s-step) * 2) !important; }
162
- .hmx3 { max-height: calc(var(--s-step) * 3) !important; }
163
- .hmx4 { max-height: calc(var(--s-step) * 4) !important; }
164
- .hmx5 { max-height: calc(var(--s-step) * 5) !important; }
165
- .hmx6 { max-height: calc(var(--s-step) * 6) !important; }
166
- .hmx7 { max-height: calc(var(--s-step) * 7) !important; }
167
- .hmx8 { max-height: calc(var(--s-step) * 8) !important; }
168
- .hmx9 { max-height: calc(var(--s-step) * 9) !important; }
169
- .hmx10 { max-height: calc(var(--s-step) * 10) !important; }
170
- .hmx11 { max-height: calc(var(--s-step) * 11) !important; }
171
- .hmx12 { max-height: var(--s-full) !important; }
172
- #stacks-internals #responsify('.hmx100', { max-height: 100% !important; });
173
- #stacks-internals #responsify('.hmx-initial', { max-height: initial !important; });
174
- #stacks-internals #responsify('.hmx-screen', { max-height: 100vh !important; });
175
-
176
- // ============================================================================
177
- // $ MIN-HEIGHT
178
- // ----------------------------------------------------------------------------
179
- .hmn0 { min-height: 0 !important; }
180
- .hmn1 { min-height: var(--s-step) !important; }
181
- .hmn2 { min-height: calc(var(--s-step) * 2) !important; }
182
- .hmn3 { min-height: calc(var(--s-step) * 3) !important; }
183
- .hmn4 { min-height: calc(var(--s-step) * 4) !important; }
184
- .hmn5 { min-height: calc(var(--s-step) * 5) !important; }
185
- .hmn6 { min-height: calc(var(--s-step) * 6) !important; }
186
- .hmn7 { min-height: calc(var(--s-step) * 7) !important; }
187
- .hmn8 { min-height: calc(var(--s-step) * 8) !important; }
188
- .hmn9 { min-height: calc(var(--s-step) * 9) !important; }
189
- .hmn10 { min-height: calc(var(--s-step) * 10) !important; }
190
- .hmn11 { min-height: calc(var(--s-step) * 11) !important; }
191
- .hmn12 { min-height: var(--s-full) !important; }
192
- #stacks-internals #responsify('.hmn100', { min-height: 100% !important; });
193
- #stacks-internals #responsify('.hmn-initial', { min-height: initial !important; });
194
- #stacks-internals #responsify('.hmn-screen', { min-height: 100vh !important; });
@@ -1,82 +0,0 @@
1
- a.s-block-link,
2
- .s-block-link {
3
- --_bl-bs-color: var(--theme-primary);
4
- --_bl-bg: transparent;
5
- --_bl-fc: var(--black-500);
6
- --_bl-fc-hover: var(--black-600);
7
- --_bl-fc-visited: var(--_bl-fc);
8
-
9
- // CONTEXTUAL STYLES
10
- .dark-mode({
11
- &.is-selected {
12
- --_bl-bg: var(--black-100);
13
- }
14
- });
15
-
16
- // STATES
17
- &.is-selected {
18
- --_bl-bg: var(--black-150);
19
- --_bl-fc: var(--black-600);
20
-
21
- font-weight: bold;
22
- }
23
-
24
- // MODIFIERS
25
- &&__left,
26
- &&__right {
27
- &.is-selected {
28
- &:not(:focus-visible):not(.focus-inset) {
29
- box-shadow: inset var(--_li-block-bs-offset-x, 3px) 0 0 var(--_bl-bs-color);
30
- }
31
- }
32
- }
33
-
34
- &&__right {
35
- &.is-selected {
36
- --_li-block-bs-offset-x: calc(var(--su-static1) - var(--su-static4)); // -3px
37
- }
38
- }
39
-
40
- // VARIANTS
41
- &&__danger {
42
- --_bl-fc: var(--red-400);
43
- --_bl-fc-hover: var(--red-500);
44
- --_bl-fc-visited: var(--red-500);
45
- }
46
-
47
- &:active,
48
- &:hover {
49
- &,
50
- &:visited {
51
- color: var(--_bl-fc-hover);
52
- }
53
- }
54
-
55
- &:visited {
56
- color: var(--_bl-fc-visited);
57
- }
58
-
59
- &:focus-visible {
60
- .focus-styles(true);
61
- }
62
-
63
- &:focus-visible,
64
- &.focus-inset {
65
- border-radius: var(--br-md);
66
- }
67
-
68
- background-color: var(--_bl-bg); // [1]
69
- color: var(--_bl-fc);
70
-
71
- border-radius: 0; // [1]
72
- border: none; // [1]
73
- cursor: pointer; // [1]
74
- display: block;
75
- font-family: inherit; // [1]
76
- line-height: inherit; // [1]
77
- padding: var(--su6) var(--su12);
78
- text-align: left; // [1]
79
- width: 100%;
80
- }
81
-
82
- // [1] Normalize for when applying to a button
@@ -1,41 +0,0 @@
1
- .s-breadcrumbs {
2
- --_br-divider-px: var(--su4);
3
- --_br-link-fc: var(--fc-light);
4
-
5
- // CONTEXTUAL STYLES
6
- #stacks-internals #screen-sm({
7
- --_br-divider-px: var(--su2);
8
- });
9
-
10
- // CHILD ELEMENTS
11
- & &--divider {
12
- .highcontrast-mode({
13
- color: var(--fc-light);
14
- });
15
-
16
- margin-left: var(--_br-divider-px);
17
- margin-right: var(--_br-divider-px);
18
- }
19
-
20
- & &--item {
21
- align-items: center;
22
- display: flex;
23
- flex-wrap: nowrap;
24
- margin-bottom: var(--su2);
25
- margin-top: var(--su2);
26
- }
27
-
28
- & &--link {
29
- color: var(--_br-link-fc);
30
-
31
- &:hover {
32
- --_br-link-fc: var(--fc-medium);
33
- }
34
- }
35
-
36
- align-items: flex-start;
37
- color: var(--black-300);
38
- display: flex;
39
- flex-wrap: wrap;
40
- font-size: var(--fs-caption);
41
- }
@@ -1,81 +0,0 @@
1
- .s-btn-group {
2
- // CONTEXTUAL STYLES
3
- #stacks-internals #screen-sm({
4
- .s-btn {
5
- --_bu-px: 0.4em;
6
-
7
- &.s-btn__dropdown {
8
- padding-right: 1.2em;
9
-
10
- &:after {
11
- right: var(--_bu-px);
12
- }
13
- }
14
- }
15
- }, @force-selector: true);
16
-
17
- // CHILD ELEMENTS
18
- form {
19
- display: flex;
20
- margin-right: calc(var(--su-static1) * -1); // -1px
21
- }
22
-
23
- // --_bu-py values set below to ensure btn-group height matches same-sized button height
24
- // See https://github.com/StackEng/StackOverflow/pull/18992#pullrequestreview-1947490680
25
- .s-btn {
26
- --_bu-br: var(--br-md);
27
- --_bu-bc-hover: transparent;
28
- --_bu-px: calc(var(--su12) - var(--su1)); // 11px
29
- --_bu-py: calc(var(--su6) + 0.65px); // 6.65px
30
-
31
- &.s-btn__xs {
32
- --_bu-px: calc(var(--su8) - var(--su1)); // 7px
33
- --_bu-py: calc(var(--su2) + 0.9px); // 2.9px
34
- }
35
-
36
- &.s-btn__sm {
37
- --_bu-px: calc(var(--su8) + var(--su1)); // 9px
38
- --_bu-py: calc(var(--su4) + (var(--su2) - 0.15px)); // 5.85px
39
- }
40
-
41
- &.s-btn__md {
42
- --_bu-px: var(--su12);
43
- --_bu-py: calc(var(--su8) + 0.15px); // 8.15px
44
- }
45
-
46
- &.is-selected,
47
- &--radio:checked + .s-btn {
48
- font-weight: bold;
49
- }
50
-
51
- .s-btn--badge {
52
- // set negative margins so button height isn't affect by badge
53
- margin-bottom: -100%;
54
- margin-top: -100%;
55
- font-weight: normal;
56
- }
57
-
58
- & .s-btn--text {
59
- &:before {
60
- content: attr(data-text);
61
- font-weight: bold;
62
- height: 0;
63
- pointer-events: none;
64
- user-select: none;
65
- visibility: hidden;
66
- }
67
-
68
- display: inline-flex;
69
- flex-direction: column;
70
- }
71
-
72
- white-space: nowrap; // When the buttons wrap, they get super tall and mess up the whole layout
73
- }
74
-
75
- // STATIC COMPONENT STYLES
76
- border: var(--su-static1) solid var(--black-300);
77
- border-radius: var(--br-md);
78
- display: inline-flex;
79
- flex-wrap: wrap;
80
- padding: calc(var(--su-static4) - var(--su-static1));
81
- }
@@ -1,37 +0,0 @@
1
- .s-card {
2
- --_ca-bc: var(--bc-medium);
3
-
4
- // CONTEXTUAL STYLES
5
- a& {
6
- text-decoration: none !important;
7
- }
8
-
9
- // VARIANTS
10
- &&__muted {
11
- --_ca-bc: var(--bc-light);
12
-
13
- // Dim only the first child card content
14
- > * {
15
- opacity: 0.65;
16
-
17
- .dark-mode({
18
- opacity: 0.7;
19
- });
20
-
21
- .highcontrast-mode({
22
- opacity: 0.75;
23
- });
24
- }
25
- }
26
-
27
- // CHILD ELEMENTS
28
- > :last-child {
29
- margin-bottom: 0;
30
- }
31
-
32
- border: var(--su-static1) solid var(--_ca-bc);
33
-
34
- background-color: var(--white);
35
- border-radius: var(--br-md);
36
- padding: var(--su12);
37
- }
@@ -1,17 +0,0 @@
1
- .s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
2
- --_cc-ai: center;
3
-
4
- // CONTEXTUAL STYLES
5
- .s-check-group & {
6
- --_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
7
- }
8
-
9
- // CHILD ELEMENTS
10
- .s-label {
11
- font-weight: normal;
12
- }
13
-
14
- align-items: var(--_cc-ai);
15
- display: flex;
16
- gap: var(--su8);
17
- }
@@ -1,19 +0,0 @@
1
- .s-check-group {
2
- --_cg-fd: column;
3
-
4
- // MODIFIERS
5
- &&__horizontal {
6
- --_cg-fd: row;
7
- }
8
-
9
- // CHILD ELEMENTS
10
- // TODO HACK? <legend> isn't respecting gap...
11
- legend.s-label {
12
- margin-bottom: var(--su8);
13
- }
14
-
15
- flex-direction: var(--_cg-fd);
16
-
17
- display: flex;
18
- gap: var(--su8);
19
- }
@@ -1,119 +0,0 @@
1
- .s-expandable { // [1]
2
- // COMPONENT-SPECIFIC CONSTANTS
3
- @ex-clip-path: polygon(-1000000px -1000000px, 1000000px -1000000px, 1000000px 1000000px, -1000000px 1000000px);
4
- @ex-min-expected-height: 10px;
5
- @ex-transition-duration: 100ms;
6
- // COMPONENT-SPECIFIC CUSTOM PROPERTIES
7
- --_ex-after-h: 10px;
8
- --_ex-after-hmx: 0;
9
- --_ex-after-transition:
10
- height @ex-transition-duration linear,
11
- max-height 0s @ex-transition-duration linear;
12
- --_ex-content-hmx: 1000000px;
13
- --_ex-content-mb: 0;
14
- --_ex-content-o: unset;
15
- --_ex-content-transform: unset;
16
- --_ex-content-transition:
17
- margin-bottom @ex-transition-duration cubic-bezier(0, 0, 0, 1),
18
- transform @ex-transition-duration cubic-bezier(1, 0, 1, 1),
19
- opacity @ex-transition-duration cubic-bezier(1, 0, 1, 1);
20
- --_ex-content-v: unset;
21
-
22
- &:not(.is-expanded) {
23
- --_ex-after-h: 0;
24
- --_ex-after-hmx: @ex-min-expected-height;
25
- --_ex-after-transition: height @ex-min-expected-height linear;
26
- --_ex-content-hmx: 0;
27
- --_ex-content-mb: -1500px;
28
- --_ex-content-o: 0;
29
- --_ex-content-transform: scaleY(0);
30
- --_ex-content-transition:
31
- margin-bottom @ex-transition-duration cubic-bezier(1, 0, 1, 1),
32
- visibility 0s @ex-transition-duration,
33
- max-height 0s @ex-transition-duration,
34
- transform @ex-transition-duration cubic-bezier(0, 1, 1, 1),
35
- opacity @ex-transition-duration cubic-bezier(0, 1, 1, 1);
36
- --_ex-content-v: hidden;
37
-
38
- & .s-expandable--content {
39
- @supports ((-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)) or (clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%))) {
40
- --_ex-content-o: 0;
41
- --_ex-content-transform: none;
42
- }
43
- }
44
-
45
- -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
46
- clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
47
- overflow: hidden;
48
- transition: none;
49
- }
50
-
51
- &:after {
52
- height: var(--_ex-after-h);
53
- max-height: var(--_ex-after-hmx);
54
- transition: var(--_ex-after-transition);
55
-
56
- -ms-flex-preferred-size: 0;
57
- content: '';
58
- flex-basis: 0;
59
- }
60
-
61
- & &--content {
62
- max-height: var(--_ex-content-hmx);
63
- margin-bottom: var(--_ex-content-mb);
64
- opacity: var(--_ex-content-o);
65
- -webkit-transform: var(--_ex-content-transform);
66
- transform: var(--_ex-content-transform);
67
- visibility: var(--_ex-content-v);
68
-
69
- -ms-flex-preferred-size: 100%;
70
- flex-basis: 100%;
71
- -webkit-transform-origin: 0 0;
72
- transform-origin: 0 0;
73
- transition: var(--_ex-content-transition);
74
- }
75
-
76
- align-items: flex-start; // see comment above
77
- display: flex;
78
- -webkit-clip-path: @ex-clip-path;
79
- clip-path: @ex-clip-path;
80
- transition: clip-path 0s var(--_ex-transition-duration), -webkit-clip-path 0s var(--_ex-transition-duration);
81
- }
82
-
83
- // [1] see http://stackoverflow.com/a/43965099 for how this works:
84
-
85
- // Notes on the clip-path stuff: What we would really like is overflow: hidden during the transition,
86
- // but not when the element is expanded. Unfortunately, although the CSS spec provides for it, there's
87
- // no browser support yet for transitioning non-interpolatable properties, and therefore we cannot say
88
- // "change overflow to visible *after* the transition".
89
- //
90
- // So we use clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%), which is essentially the same
91
- // as overflow: hidden, but unlike overflow, clip-path is interpolatable -- but only if the opposite state
92
- // is also a polygon, and has the same vertice count. So our version of overflow: visible is a rectangle
93
- // of 2x2 million pixels, which should be enough for everybody (TM).
94
- //
95
- // At the time of writing, clip-path works in Chrome, Firefox Beta, and Safari (with vendor prefix).
96
- //
97
- // In browsers that do not support this yet, we have to have another way to prevent the expandable content
98
- // from being visible below the bottom edge during the transition, and the best I could come up with is
99
- // transitioning to scaleY(0) with a timing function that's faster than the height-reducing transitions.
100
- // This does kinda look like a deliberate effect, even more so if we also transition to transparency
101
- // (which we therefore do), so I feel it's an okay fallback.
102
- //
103
- // We still set overflow to hidden in the collapsed state (which also applies to the collapsing transition),
104
- // we just can't do that for the expanding transition.
105
- //
106
- // A major drawback of clip-path is that even though the content is clipped (not visible), it will still
107
- // contribute to the document height. This caused a jumping around of the scrollbar (and possibly even
108
- // of the viewport) when the expandable was at the bottom of the page, because once the negative bottom
109
- // margin of the -expandable-group exceeds the actual height, any additional pixels were added on to the
110
- // bottom. The fix is to set the -expandable-group's flex alignment to flex-start, which forces the
111
- // (no longer visible) element itself to remain at the top, thereby forcing the excess pixels to be added
112
- // above the top, not below the bottom. And because extending content above the document top will not do
113
- // anything to the document height, there is no jumping during the transition.
114
- // see "@ex-transition-duration"
115
-
116
- // Per the answer referenced above, the component can only guarantee smooth transitions if above a minimum
117
- // height and can only guarantee the element will be hidden is below a maximimum height.
118
- // The minimum height has been set at 10px because that's below the height of a single line of text in an s-description.
119
- // see "@ex-min-expected-height" and "--_ex-content-mb"