@stackoverflow/stacks 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +158 -180
  3. package/dist/css/stacks.css +6 -0
  4. package/dist/js/stacks.min.js +1 -1
  5. package/lib/atomic/border.less +139 -139
  6. package/lib/atomic/color.less +36 -36
  7. package/lib/atomic/flex.less +426 -426
  8. package/lib/atomic/gap.less +44 -44
  9. package/lib/atomic/grid.less +139 -139
  10. package/lib/atomic/misc.less +374 -374
  11. package/lib/atomic/spacing.less +98 -98
  12. package/lib/atomic/typography.less +266 -264
  13. package/lib/atomic/width-height.less +194 -194
  14. package/lib/base/body.less +44 -44
  15. package/lib/base/configuration-static.less +61 -61
  16. package/lib/base/fieldset.less +5 -5
  17. package/lib/base/icon.less +11 -11
  18. package/lib/base/internal.less +220 -220
  19. package/lib/base/reset-meyer.less +64 -64
  20. package/lib/base/reset-normalize.less +449 -449
  21. package/lib/base/reset.less +20 -20
  22. package/lib/components/activity-indicator/activity-indicator.less +53 -53
  23. package/lib/components/avatar/avatar.less +108 -108
  24. package/lib/components/award-bling/award-bling.less +31 -31
  25. package/lib/components/banner/banner.less +44 -44
  26. package/lib/components/banner/banner.ts +149 -149
  27. package/lib/components/block-link/block-link.less +82 -82
  28. package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
  29. package/lib/components/button-group/button-group.less +82 -82
  30. package/lib/components/card/card.less +37 -37
  31. package/lib/components/check-control/check-control.less +17 -17
  32. package/lib/components/check-group/check-group.less +19 -19
  33. package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
  34. package/lib/components/code-block/code-block.fixtures.ts +88 -88
  35. package/lib/components/code-block/code-block.less +116 -116
  36. package/lib/components/description/description.less +9 -9
  37. package/lib/components/empty-state/empty-state.less +16 -16
  38. package/lib/components/expandable/expandable.less +118 -118
  39. package/lib/components/input-fill/input-fill.less +35 -35
  40. package/lib/components/input-icon/input-icon.less +45 -45
  41. package/lib/components/input-message/input-message.less +49 -49
  42. package/lib/components/label/label.less +110 -110
  43. package/lib/components/link-preview/link-preview.less +148 -148
  44. package/lib/components/menu/menu.less +41 -41
  45. package/lib/components/modal/modal.less +118 -118
  46. package/lib/components/modal/modal.ts +383 -383
  47. package/lib/components/navigation/navigation.less +136 -136
  48. package/lib/components/navigation/navigation.ts +128 -128
  49. package/lib/components/page-title/page-title.less +51 -51
  50. package/lib/components/popover/popover.less +159 -159
  51. package/lib/components/popover/popover.ts +651 -651
  52. package/lib/components/post-summary/post-summary.less +457 -457
  53. package/lib/components/progress-bar/progress-bar.less +291 -291
  54. package/lib/components/prose/prose.less +452 -452
  55. package/lib/components/select/select.less +138 -138
  56. package/lib/components/spinner/spinner.less +103 -103
  57. package/lib/components/table/table.ts +296 -296
  58. package/lib/components/table-container/table-container.less +4 -4
  59. package/lib/components/tag/tag.less +186 -186
  60. package/lib/components/toast/toast.less +35 -35
  61. package/lib/components/toast/toast.ts +357 -357
  62. package/lib/components/toggle-switch/toggle-switch.less +104 -104
  63. package/lib/components/topbar/topbar.less +553 -553
  64. package/lib/components/uploader/uploader.less +205 -205
  65. package/lib/components/user-card/user-card.less +129 -129
  66. package/lib/controllers.ts +33 -33
  67. package/lib/exports/color-mixins.less +283 -283
  68. package/lib/exports/constants-helpers.less +108 -108
  69. package/lib/exports/constants-type.less +155 -155
  70. package/lib/exports/exports.less +15 -15
  71. package/lib/exports/mixins.less +334 -333
  72. package/lib/exports/spacing-mixins.less +67 -67
  73. package/lib/index.ts +32 -32
  74. package/lib/input-utils.less +41 -41
  75. package/lib/stacks-dynamic.less +24 -24
  76. package/lib/stacks-static.less +93 -93
  77. package/lib/stacks.less +13 -13
  78. package/lib/test/assertions.ts +36 -36
  79. package/lib/test/less-test-utils.ts +28 -28
  80. package/lib/test/open-wc-testing-patch.d.ts +26 -26
  81. package/lib/tsconfig.build.json +4 -4
  82. package/lib/tsconfig.json +17 -17
  83. package/package.json +26 -22
@@ -1,20 +1,20 @@
1
- // the default CSS reset is normalize.css; other possibilities are the Eric Meyer reset, and no reset at all.
2
-
3
- #stacks-internals() {
4
- #include-css-reset(meyer) {
5
- @import "reset-meyer.less";
6
- }
7
- #include-css-reset(normalize) {
8
- @import "reset-normalize.less";
9
- }
10
- /* stylelint-disable block-no-empty */
11
- #include-css-reset(none) {
12
- }
13
- /* stylelint-enable */
14
- }
15
-
16
- & {
17
- #stacks-internals #load-static-config();
18
- #stacks-internals #include-css-reset(@css-reset);
19
- }
20
-
1
+ // the default CSS reset is normalize.css; other possibilities are the Eric Meyer reset, and no reset at all.
2
+
3
+ #stacks-internals() {
4
+ #include-css-reset(meyer) {
5
+ @import "reset-meyer.less";
6
+ }
7
+ #include-css-reset(normalize) {
8
+ @import "reset-normalize.less";
9
+ }
10
+ /* stylelint-disable block-no-empty */
11
+ #include-css-reset(none) {
12
+ }
13
+ /* stylelint-enable */
14
+ }
15
+
16
+ & {
17
+ #stacks-internals #load-static-config();
18
+ #stacks-internals #include-css-reset(@css-reset);
19
+ }
20
+
@@ -1,53 +1,53 @@
1
- .s-activity-indicator {
2
- --_ai-translucent: var(--translucent-secondary);
3
- --_ai-bg: var(--theme-secondary-400);
4
- --_ai-fc: var(--white);
5
-
6
- .highcontrast-mode({
7
- --_ai-bg: var(--theme-secondary-500);
8
- });
9
-
10
- // VARIANTS
11
- &&__danger {
12
- --_ai-bg: var(--red-400);
13
- --_ai-translucent: var(--translucent-error);
14
-
15
- .highcontrast-mode({
16
- --_ai-bg: var(--red-500);
17
- });
18
- }
19
-
20
- &&__success {
21
- --_ai-bg: var(--green-400);
22
- --_ai-translucent: var(--translucent-success);
23
-
24
- .highcontrast-mode({
25
- --_ai-bg: var(--green-500);
26
- });
27
- }
28
-
29
- &&__warning {
30
- --_ai-bg: var(--yellow-400);
31
- --_ai-fc: var(--_black-static);
32
- --_ai-translucent: var(--translucent-warning);
33
-
34
- .highcontrast-mode({
35
- --_ai-bg: var(--yellow-500); // needs to be here to override default high contrast
36
- --_ai-fc: var(--white);
37
- });
38
- }
39
-
40
- background-color: var(--_ai-bg);
41
- box-shadow: 0 0 0 var(--su-static4) var(--_ai-translucent);
42
- color: var(--_ai-fc);
43
-
44
- border-radius: 1000px;
45
- display: inline-block;
46
- font-size: var(--fs-fine);
47
- font-weight: 700;
48
- line-height: 1.1; // Custom line-height to satisfy 1x screens
49
- min-width: var(--su-static12);
50
- min-height: var(--su-static12);
51
- padding: var(--su2) var(--su4);
52
- text-transform: uppercase;
53
- }
1
+ .s-activity-indicator {
2
+ --_ai-translucent: var(--translucent-secondary);
3
+ --_ai-bg: var(--theme-secondary-400);
4
+ --_ai-fc: var(--white);
5
+
6
+ .highcontrast-mode({
7
+ --_ai-bg: var(--theme-secondary-500);
8
+ });
9
+
10
+ // VARIANTS
11
+ &&__danger {
12
+ --_ai-bg: var(--red-400);
13
+ --_ai-translucent: var(--translucent-error);
14
+
15
+ .highcontrast-mode({
16
+ --_ai-bg: var(--red-500);
17
+ });
18
+ }
19
+
20
+ &&__success {
21
+ --_ai-bg: var(--green-400);
22
+ --_ai-translucent: var(--translucent-success);
23
+
24
+ .highcontrast-mode({
25
+ --_ai-bg: var(--green-500);
26
+ });
27
+ }
28
+
29
+ &&__warning {
30
+ --_ai-bg: var(--yellow-400);
31
+ --_ai-fc: var(--_black-static);
32
+ --_ai-translucent: var(--translucent-warning);
33
+
34
+ .highcontrast-mode({
35
+ --_ai-bg: var(--yellow-500); // needs to be here to override default high contrast
36
+ --_ai-fc: var(--white);
37
+ });
38
+ }
39
+
40
+ background-color: var(--_ai-bg);
41
+ box-shadow: 0 0 0 var(--su-static4) var(--_ai-translucent);
42
+ color: var(--_ai-fc);
43
+
44
+ border-radius: 1000px;
45
+ display: inline-block;
46
+ font-size: var(--fs-fine);
47
+ font-weight: 700;
48
+ line-height: 1.1; // Custom line-height to satisfy 1x screens
49
+ min-width: var(--su-static12);
50
+ min-height: var(--su-static12);
51
+ padding: var(--su2) var(--su4);
52
+ text-transform: uppercase;
53
+ }
@@ -1,108 +1,108 @@
1
- .s-avatar {
2
- --_av-size: var(--su-static16);
3
- --_av-bg: var(--_white-static); // Force a white background color for when we have transparent avatars
4
- --_av-br: var(--br-sm);
5
- --_av-fs-letter: calc(var(--su-static12) - var(--su-static1));
6
- --_av-scale-badge: 1;
7
-
8
- // CONTEXTUAL STYLES
9
- .highcontrast-mode({
10
- .s-avatar--letter {
11
- color: var(--white);
12
- }
13
-
14
- background-color: var(--black);
15
- box-shadow: 0 0 0 var(--su-static1) var(--black);
16
- color: var(--white);
17
- });
18
-
19
- // MODIFIERS
20
- // Sizes
21
- &&__32,
22
- &&__48 {
23
- --_av-br: var(--br-md);
24
- }
25
-
26
- &&__96,
27
- &&__128 {
28
- --_av-br: calc(var(--br-lg) + var(--br-sm));
29
- --_av-scale-badge: 3;
30
- }
31
-
32
- &&__24 {
33
- --_av-size: var(--su-static24);
34
- --_av-fs-letter: var(--su-static16);
35
- --_av-scale-badge: 1.1;
36
- }
37
-
38
- &&__32 {
39
- --_av-size: var(--su-static32);
40
- --_av-fs-letter: calc(var(--su-static24) - var(--su-static2));
41
- --_av-scale-badge: 1.3;
42
- }
43
-
44
- &&__48 {
45
- --_av-size: var(--su-static48);
46
- --_av-fs-letter: calc(var(--su-static32) + var(--su-static2));
47
- --_av-scale-badge: 1.6;
48
- }
49
-
50
- &&__64 {
51
- --_av-size: var(--su-static64);
52
- --_av-br: var(--br-lg);
53
- --_av-fs-letter: calc(var(--su-static48) - var(--su-static4));
54
- --_av-scale-badge: 2.4;
55
- }
56
-
57
- &&__96 {
58
- --_av-size: var(--su-static96);
59
- --_av-fs-letter: calc(var(--su-static64) + var(--su-static2));
60
- }
61
-
62
- &&__128 {
63
- --_av-size: var(--su-static128);
64
- --_av-fs-letter: calc(var(--su-static96) - var(--su-static8));
65
- }
66
-
67
- // CHILD ELEMENTS
68
- & &--badge {
69
- bottom: calc(var(--su-static4) * -1); // -4px
70
- position: absolute;
71
- right: calc(var(--su-static4) * -1); // -4px
72
- -webkit-transform: scale(var(--_av-scale-badge));
73
- transform: scale(var(--_av-scale-badge));
74
- }
75
-
76
- & &--image {
77
- border-radius: var(--_av-br);
78
- display: block;
79
- height: var(--_av-size);
80
- width: var(--_av-size);
81
- }
82
-
83
- & &--letter {
84
- color: var(--_white-static); // Force a light appearance of text rendering
85
- display: block; // Make sure we're treating the letter as a block-level element
86
- font-size: var(--_av-fs-letter); // Force a font size so the avatar text doesn't get smaller as the window resizes
87
- font-weight: bold;
88
- line-height: 1.4; // Guards against some line-height trolling from the parent
89
- text-align: center;
90
- text-transform: uppercase; // Force uppercase in avatars when team name is lowercase
91
- // We don't need text selection on our letter
92
- -webkit-user-select: none;
93
- -moz-user-select: none;
94
- -ms-user-select: none;
95
- user-select: none;
96
- }
97
-
98
- background-color: var(--_av-bg);
99
- border-radius: var(--_av-br);
100
- height: var(--_av-size);
101
- width: var(--_av-size);
102
-
103
- background-repeat: no-repeat;
104
- background-size: 100%;
105
- display: inline-block; // Make sure the avatar has structure regardless of the element eg. span vs. div
106
- position: relative;
107
- vertical-align: bottom; // Make our avatars play more nicely with text next to it.
108
- }
1
+ .s-avatar {
2
+ --_av-size: var(--su-static16);
3
+ --_av-bg: var(--_white-static); // Force a white background color for when we have transparent avatars
4
+ --_av-br: var(--br-sm);
5
+ --_av-fs-letter: calc(var(--su-static12) - var(--su-static1));
6
+ --_av-scale-badge: 1;
7
+
8
+ // CONTEXTUAL STYLES
9
+ .highcontrast-mode({
10
+ .s-avatar--letter {
11
+ color: var(--white);
12
+ }
13
+
14
+ background-color: var(--black);
15
+ box-shadow: 0 0 0 var(--su-static1) var(--black);
16
+ color: var(--white);
17
+ });
18
+
19
+ // MODIFIERS
20
+ // Sizes
21
+ &&__32,
22
+ &&__48 {
23
+ --_av-br: var(--br-md);
24
+ }
25
+
26
+ &&__96,
27
+ &&__128 {
28
+ --_av-br: calc(var(--br-lg) + var(--br-sm));
29
+ --_av-scale-badge: 3;
30
+ }
31
+
32
+ &&__24 {
33
+ --_av-size: var(--su-static24);
34
+ --_av-fs-letter: var(--su-static16);
35
+ --_av-scale-badge: 1.1;
36
+ }
37
+
38
+ &&__32 {
39
+ --_av-size: var(--su-static32);
40
+ --_av-fs-letter: calc(var(--su-static24) - var(--su-static2));
41
+ --_av-scale-badge: 1.3;
42
+ }
43
+
44
+ &&__48 {
45
+ --_av-size: var(--su-static48);
46
+ --_av-fs-letter: calc(var(--su-static32) + var(--su-static2));
47
+ --_av-scale-badge: 1.6;
48
+ }
49
+
50
+ &&__64 {
51
+ --_av-size: var(--su-static64);
52
+ --_av-br: var(--br-lg);
53
+ --_av-fs-letter: calc(var(--su-static48) - var(--su-static4));
54
+ --_av-scale-badge: 2.4;
55
+ }
56
+
57
+ &&__96 {
58
+ --_av-size: var(--su-static96);
59
+ --_av-fs-letter: calc(var(--su-static64) + var(--su-static2));
60
+ }
61
+
62
+ &&__128 {
63
+ --_av-size: var(--su-static128);
64
+ --_av-fs-letter: calc(var(--su-static96) - var(--su-static8));
65
+ }
66
+
67
+ // CHILD ELEMENTS
68
+ & &--badge {
69
+ bottom: calc(var(--su-static4) * -1); // -4px
70
+ position: absolute;
71
+ right: calc(var(--su-static4) * -1); // -4px
72
+ -webkit-transform: scale(var(--_av-scale-badge));
73
+ transform: scale(var(--_av-scale-badge));
74
+ }
75
+
76
+ & &--image {
77
+ border-radius: var(--_av-br);
78
+ display: block;
79
+ height: var(--_av-size);
80
+ width: var(--_av-size);
81
+ }
82
+
83
+ & &--letter {
84
+ color: var(--_white-static); // Force a light appearance of text rendering
85
+ display: block; // Make sure we're treating the letter as a block-level element
86
+ font-size: var(--_av-fs-letter); // Force a font size so the avatar text doesn't get smaller as the window resizes
87
+ font-weight: bold;
88
+ line-height: 1.4; // Guards against some line-height trolling from the parent
89
+ text-align: center;
90
+ text-transform: uppercase; // Force uppercase in avatars when team name is lowercase
91
+ // We don't need text selection on our letter
92
+ -webkit-user-select: none;
93
+ -moz-user-select: none;
94
+ -ms-user-select: none;
95
+ user-select: none;
96
+ }
97
+
98
+ background-color: var(--_av-bg);
99
+ border-radius: var(--_av-br);
100
+ height: var(--_av-size);
101
+ width: var(--_av-size);
102
+
103
+ background-repeat: no-repeat;
104
+ background-size: 100%;
105
+ display: inline-block; // Make sure the avatar has structure regardless of the element eg. span vs. div
106
+ position: relative;
107
+ vertical-align: bottom; // Make our avatars play more nicely with text next to it.
108
+ }
@@ -1,31 +1,31 @@
1
- .s-award-bling {
2
- --_ab-before-bg: unset;
3
-
4
- // VARIANTS
5
- &&__gold {
6
- --_ab-before-bg: var(--gold-300);
7
- }
8
-
9
- &&__silver {
10
- --_ab-before-bg: var(--silver-300);
11
- }
12
-
13
- &&__bronze {
14
- --_ab-before-bg: var(--bronze-300);
15
- }
16
-
17
- // CHILD ELEMENTS
18
- &:before {
19
- background-color: var(--_ab-before-bg);
20
-
21
- border-radius: 100%;
22
- content: "";
23
- margin-right: var(--su4);
24
- height: var(--su8);
25
- width: var(--su8);
26
- }
27
-
28
- align-items: center;
29
- color: inherit;
30
- display: flex;
31
- }
1
+ .s-award-bling {
2
+ --_ab-before-bg: unset;
3
+
4
+ // VARIANTS
5
+ &&__gold {
6
+ --_ab-before-bg: var(--gold-300);
7
+ }
8
+
9
+ &&__silver {
10
+ --_ab-before-bg: var(--silver-300);
11
+ }
12
+
13
+ &&__bronze {
14
+ --_ab-before-bg: var(--bronze-300);
15
+ }
16
+
17
+ // CHILD ELEMENTS
18
+ &:before {
19
+ background-color: var(--_ab-before-bg);
20
+
21
+ border-radius: 100%;
22
+ content: "";
23
+ margin-right: var(--su4);
24
+ height: var(--su8);
25
+ width: var(--su8);
26
+ }
27
+
28
+ align-items: center;
29
+ color: inherit;
30
+ display: flex;
31
+ }
@@ -1,44 +1,44 @@
1
- // See also ./lib/components/notice/notice.less
2
- // TODO deprecate .s-banner (by turning it into a modifier on .s-notice)
3
- // This would reduce the amount of CSS we ship to the client and simplify our codebase
4
- .s-banner {
5
- --_no-ty-offset: 0;
6
- --_no-ty: var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8)));
7
- .construct-notice-component(s-banner);
8
-
9
- &[aria-hidden="true"] { // If you want to hide and reveal the banner
10
- --_no-ty-offset: -1;
11
- opacity: 0;
12
- visibility: hidden;
13
- }
14
-
15
- &[aria-hidden="false"] {
16
- --_no-ty-offset: 1;
17
- opacity: 1;
18
- visibility: visible;
19
-
20
- &.is-pinned { // If you want to put the banner above the topbar
21
- --_no-ty-offset: 0;
22
- z-index: calc(var(--zi-navigation-fixed) + 1);
23
- }
24
- }
25
-
26
- &__body-pt {
27
- padding-top: 93px;
28
- }
29
-
30
- & &--container { // When we want to keep hero content capped
31
- margin: 0 auto;
32
- max-width: calc(var(--s-step) * 10);
33
- position: relative;
34
- width: 100%;
35
- }
36
-
37
- border-width: 0 0 var(--su-static1);
38
- inset: 0 0 auto 0;
39
- padding: var(--su12);
40
- position: fixed;
41
- transform: translate3d(0, calc(var(--_no-ty) * var(--_no-ty-offset)), 0);
42
- width: 100%;
43
- z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
44
- }
1
+ // See also ./lib/components/notice/notice.less
2
+ // TODO deprecate .s-banner (by turning it into a modifier on .s-notice)
3
+ // This would reduce the amount of CSS we ship to the client and simplify our codebase
4
+ .s-banner {
5
+ --_no-ty-offset: 0;
6
+ --_no-ty: var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8)));
7
+ .construct-notice-component(s-banner);
8
+
9
+ &[aria-hidden="true"] { // If you want to hide and reveal the banner
10
+ --_no-ty-offset: -1;
11
+ opacity: 0;
12
+ visibility: hidden;
13
+ }
14
+
15
+ &[aria-hidden="false"] {
16
+ --_no-ty-offset: 1;
17
+ opacity: 1;
18
+ visibility: visible;
19
+
20
+ &.is-pinned { // If you want to put the banner above the topbar
21
+ --_no-ty-offset: 0;
22
+ z-index: calc(var(--zi-navigation-fixed) + 1);
23
+ }
24
+ }
25
+
26
+ &__body-pt {
27
+ padding-top: 93px;
28
+ }
29
+
30
+ & &--container { // When we want to keep hero content capped
31
+ margin: 0 auto;
32
+ max-width: calc(var(--s-step) * 10);
33
+ position: relative;
34
+ width: 100%;
35
+ }
36
+
37
+ border-width: 0 0 var(--su-static1);
38
+ inset: 0 0 auto 0;
39
+ padding: var(--su12);
40
+ position: fixed;
41
+ transform: translate3d(0, calc(var(--_no-ty) * var(--_no-ty-offset)), 0);
42
+ width: 100%;
43
+ z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
44
+ }