@stackoverflow/stacks 2.0.0-rc.4 → 2.0.0-rc.6

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 (34) hide show
  1. package/dist/components/code-block/code-block.fixtures.d.ts +2 -0
  2. package/dist/css/stacks.css +136 -182
  3. package/dist/css/stacks.min.css +1 -1
  4. package/lib/atomic/__snapshots__/color.less.test.ts.snap +246 -0
  5. package/lib/base/body.less +2 -2
  6. package/lib/components/anchor/anchor.less +3 -3
  7. package/lib/components/anchor/anchor.visual.test.ts +1 -1
  8. package/lib/components/avatar/avatar.visual.test.ts +1 -1
  9. package/lib/components/banner/banner.less +2 -2
  10. package/lib/components/button/button.a11y.test.ts +1 -1
  11. package/lib/components/button/button.less +31 -31
  12. package/lib/components/button/button.visual.test.ts +1 -1
  13. package/lib/components/code-block/code-block.a11y.test.ts +30 -0
  14. package/lib/components/code-block/code-block.fixtures.ts +88 -0
  15. package/lib/components/code-block/code-block.visual.test.ts +20 -0
  16. package/lib/components/link/link.less +6 -6
  17. package/lib/components/link-preview/link-preview.less +3 -3
  18. package/lib/components/navigation/navigation.a11y.test.ts +80 -0
  19. package/lib/components/navigation/navigation.visual.test.ts +101 -0
  20. package/lib/components/notice/notice.a11y.test.ts +1 -1
  21. package/lib/components/pagination/pagination.a11y.test.ts +1 -1
  22. package/lib/components/post-summary/post-summary.less +8 -8
  23. package/lib/components/prose/prose.less +1 -1
  24. package/lib/components/tag/tag.less +6 -6
  25. package/lib/components/toast/toast.a11y.test.ts +1 -1
  26. package/lib/components/topbar/topbar.less +44 -44
  27. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +16 -10
  28. package/lib/exports/__snapshots__/color.less.test.ts.snap +179 -186
  29. package/lib/exports/color-mixins.less +0 -1
  30. package/lib/exports/color.less +12 -3
  31. package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +3 -3
  32. package/lib/exports/v1/constants-colors.less +2 -2
  33. package/package.json +3 -3
  34. package/lib/exports/theme.less +0 -85
@@ -904,6 +904,132 @@ exports[`atomic: color > should output v2 atomic css classes for colors 1`] = `
904
904
  color: var(--yellow-600) !important;
905
905
  }
906
906
 
907
+ .bg-purple-100,
908
+ .h\\\\:bg-purple-100:hover,
909
+ .f\\\\:bg-purple-100:focus,
910
+ .f\\\\:bg-purple-100:focus-within {
911
+ background-color: var(--purple-100) !important;
912
+ }
913
+
914
+ .bc-purple-100,
915
+ .h\\\\:bc-purple-100:hover,
916
+ .f\\\\:bc-purple-100:focus,
917
+ .f\\\\:bc-purple-100:focus-within {
918
+ border-color: var(--purple-100) !important;
919
+ }
920
+
921
+ .fc-purple-100,
922
+ .h\\\\:fc-purple-100:hover,
923
+ .f\\\\:fc-purple-100:focus,
924
+ .f\\\\:fc-purple-100:focus-within {
925
+ color: var(--purple-100) !important;
926
+ }
927
+
928
+ .bg-purple-200,
929
+ .h\\\\:bg-purple-200:hover,
930
+ .f\\\\:bg-purple-200:focus,
931
+ .f\\\\:bg-purple-200:focus-within {
932
+ background-color: var(--purple-200) !important;
933
+ }
934
+
935
+ .bc-purple-200,
936
+ .h\\\\:bc-purple-200:hover,
937
+ .f\\\\:bc-purple-200:focus,
938
+ .f\\\\:bc-purple-200:focus-within {
939
+ border-color: var(--purple-200) !important;
940
+ }
941
+
942
+ .fc-purple-200,
943
+ .h\\\\:fc-purple-200:hover,
944
+ .f\\\\:fc-purple-200:focus,
945
+ .f\\\\:fc-purple-200:focus-within {
946
+ color: var(--purple-200) !important;
947
+ }
948
+
949
+ .bg-purple-300,
950
+ .h\\\\:bg-purple-300:hover,
951
+ .f\\\\:bg-purple-300:focus,
952
+ .f\\\\:bg-purple-300:focus-within {
953
+ background-color: var(--purple-300) !important;
954
+ }
955
+
956
+ .bc-purple-300,
957
+ .h\\\\:bc-purple-300:hover,
958
+ .f\\\\:bc-purple-300:focus,
959
+ .f\\\\:bc-purple-300:focus-within {
960
+ border-color: var(--purple-300) !important;
961
+ }
962
+
963
+ .fc-purple-300,
964
+ .h\\\\:fc-purple-300:hover,
965
+ .f\\\\:fc-purple-300:focus,
966
+ .f\\\\:fc-purple-300:focus-within {
967
+ color: var(--purple-300) !important;
968
+ }
969
+
970
+ .bg-purple-400,
971
+ .h\\\\:bg-purple-400:hover,
972
+ .f\\\\:bg-purple-400:focus,
973
+ .f\\\\:bg-purple-400:focus-within {
974
+ background-color: var(--purple-400) !important;
975
+ }
976
+
977
+ .bc-purple-400,
978
+ .h\\\\:bc-purple-400:hover,
979
+ .f\\\\:bc-purple-400:focus,
980
+ .f\\\\:bc-purple-400:focus-within {
981
+ border-color: var(--purple-400) !important;
982
+ }
983
+
984
+ .fc-purple-400,
985
+ .h\\\\:fc-purple-400:hover,
986
+ .f\\\\:fc-purple-400:focus,
987
+ .f\\\\:fc-purple-400:focus-within {
988
+ color: var(--purple-400) !important;
989
+ }
990
+
991
+ .bg-purple-500,
992
+ .h\\\\:bg-purple-500:hover,
993
+ .f\\\\:bg-purple-500:focus,
994
+ .f\\\\:bg-purple-500:focus-within {
995
+ background-color: var(--purple-500) !important;
996
+ }
997
+
998
+ .bc-purple-500,
999
+ .h\\\\:bc-purple-500:hover,
1000
+ .f\\\\:bc-purple-500:focus,
1001
+ .f\\\\:bc-purple-500:focus-within {
1002
+ border-color: var(--purple-500) !important;
1003
+ }
1004
+
1005
+ .fc-purple-500,
1006
+ .h\\\\:fc-purple-500:hover,
1007
+ .f\\\\:fc-purple-500:focus,
1008
+ .f\\\\:fc-purple-500:focus-within {
1009
+ color: var(--purple-500) !important;
1010
+ }
1011
+
1012
+ .bg-purple-600,
1013
+ .h\\\\:bg-purple-600:hover,
1014
+ .f\\\\:bg-purple-600:focus,
1015
+ .f\\\\:bg-purple-600:focus-within {
1016
+ background-color: var(--purple-600) !important;
1017
+ }
1018
+
1019
+ .bc-purple-600,
1020
+ .h\\\\:bc-purple-600:hover,
1021
+ .f\\\\:bc-purple-600:focus,
1022
+ .f\\\\:bc-purple-600:focus-within {
1023
+ border-color: var(--purple-600) !important;
1024
+ }
1025
+
1026
+ .fc-purple-600,
1027
+ .h\\\\:fc-purple-600:hover,
1028
+ .f\\\\:fc-purple-600:focus,
1029
+ .f\\\\:fc-purple-600:focus-within {
1030
+ color: var(--purple-600) !important;
1031
+ }
1032
+
907
1033
  .bg-gold-100,
908
1034
  .h\\\\:bg-gold-100:hover,
909
1035
  .f\\\\:bg-gold-100:focus,
@@ -1928,6 +2054,54 @@ exports[`atomic: color > should output v2 atomic css classes for colors 1`] = `
1928
2054
  color: var(--yellow-600) !important;
1929
2055
  }
1930
2056
 
2057
+ body.theme-system .d\\\\:bg-purple-100 {
2058
+ background-color: var(--purple-100) !important;
2059
+ }
2060
+
2061
+ body.theme-system .d\\\\:fc-purple-100 {
2062
+ color: var(--purple-100) !important;
2063
+ }
2064
+
2065
+ body.theme-system .d\\\\:bg-purple-200 {
2066
+ background-color: var(--purple-200) !important;
2067
+ }
2068
+
2069
+ body.theme-system .d\\\\:fc-purple-200 {
2070
+ color: var(--purple-200) !important;
2071
+ }
2072
+
2073
+ body.theme-system .d\\\\:bg-purple-300 {
2074
+ background-color: var(--purple-300) !important;
2075
+ }
2076
+
2077
+ body.theme-system .d\\\\:fc-purple-300 {
2078
+ color: var(--purple-300) !important;
2079
+ }
2080
+
2081
+ body.theme-system .d\\\\:bg-purple-400 {
2082
+ background-color: var(--purple-400) !important;
2083
+ }
2084
+
2085
+ body.theme-system .d\\\\:fc-purple-400 {
2086
+ color: var(--purple-400) !important;
2087
+ }
2088
+
2089
+ body.theme-system .d\\\\:bg-purple-500 {
2090
+ background-color: var(--purple-500) !important;
2091
+ }
2092
+
2093
+ body.theme-system .d\\\\:fc-purple-500 {
2094
+ color: var(--purple-500) !important;
2095
+ }
2096
+
2097
+ body.theme-system .d\\\\:bg-purple-600 {
2098
+ background-color: var(--purple-600) !important;
2099
+ }
2100
+
2101
+ body.theme-system .d\\\\:fc-purple-600 {
2102
+ color: var(--purple-600) !important;
2103
+ }
2104
+
1931
2105
  body.theme-system .d\\\\:bg-gold-100 {
1932
2106
  background-color: var(--gold-100) !important;
1933
2107
  }
@@ -2613,6 +2787,78 @@ body.theme-system .theme-dark__forced .d\\\\:fc-yellow-600 {
2613
2787
  color: var(--yellow-600) !important;
2614
2788
  }
2615
2789
 
2790
+ body.theme-dark .d\\\\:bg-purple-100,
2791
+ .theme-dark__forced .d\\\\:bg-purple-100,
2792
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-100 {
2793
+ background-color: var(--purple-100) !important;
2794
+ }
2795
+
2796
+ body.theme-dark .d\\\\:fc-purple-100,
2797
+ .theme-dark__forced .d\\\\:fc-purple-100,
2798
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-100 {
2799
+ color: var(--purple-100) !important;
2800
+ }
2801
+
2802
+ body.theme-dark .d\\\\:bg-purple-200,
2803
+ .theme-dark__forced .d\\\\:bg-purple-200,
2804
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-200 {
2805
+ background-color: var(--purple-200) !important;
2806
+ }
2807
+
2808
+ body.theme-dark .d\\\\:fc-purple-200,
2809
+ .theme-dark__forced .d\\\\:fc-purple-200,
2810
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-200 {
2811
+ color: var(--purple-200) !important;
2812
+ }
2813
+
2814
+ body.theme-dark .d\\\\:bg-purple-300,
2815
+ .theme-dark__forced .d\\\\:bg-purple-300,
2816
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-300 {
2817
+ background-color: var(--purple-300) !important;
2818
+ }
2819
+
2820
+ body.theme-dark .d\\\\:fc-purple-300,
2821
+ .theme-dark__forced .d\\\\:fc-purple-300,
2822
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-300 {
2823
+ color: var(--purple-300) !important;
2824
+ }
2825
+
2826
+ body.theme-dark .d\\\\:bg-purple-400,
2827
+ .theme-dark__forced .d\\\\:bg-purple-400,
2828
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-400 {
2829
+ background-color: var(--purple-400) !important;
2830
+ }
2831
+
2832
+ body.theme-dark .d\\\\:fc-purple-400,
2833
+ .theme-dark__forced .d\\\\:fc-purple-400,
2834
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-400 {
2835
+ color: var(--purple-400) !important;
2836
+ }
2837
+
2838
+ body.theme-dark .d\\\\:bg-purple-500,
2839
+ .theme-dark__forced .d\\\\:bg-purple-500,
2840
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-500 {
2841
+ background-color: var(--purple-500) !important;
2842
+ }
2843
+
2844
+ body.theme-dark .d\\\\:fc-purple-500,
2845
+ .theme-dark__forced .d\\\\:fc-purple-500,
2846
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-500 {
2847
+ color: var(--purple-500) !important;
2848
+ }
2849
+
2850
+ body.theme-dark .d\\\\:bg-purple-600,
2851
+ .theme-dark__forced .d\\\\:bg-purple-600,
2852
+ body.theme-system .theme-dark__forced .d\\\\:bg-purple-600 {
2853
+ background-color: var(--purple-600) !important;
2854
+ }
2855
+
2856
+ body.theme-dark .d\\\\:fc-purple-600,
2857
+ .theme-dark__forced .d\\\\:fc-purple-600,
2858
+ body.theme-system .theme-dark__forced .d\\\\:fc-purple-600 {
2859
+ color: var(--purple-600) !important;
2860
+ }
2861
+
2616
2862
  body.theme-dark .d\\\\:bg-gold-100,
2617
2863
  .theme-dark__forced .d\\\\:bg-gold-100,
2618
2864
  body.theme-system .theme-dark__forced .d\\\\:bg-gold-100 {
@@ -18,7 +18,7 @@
18
18
 
19
19
  html,
20
20
  body {
21
- color: var(--theme-body-font-color);
21
+ color: var(--theme-body-font-color, var(--black-600));
22
22
  font-family: var(--theme-body-font-family);
23
23
  font-size: var(--fs-base);
24
24
  line-height: var(--lh-base);
@@ -34,7 +34,7 @@ body {
34
34
  body {
35
35
  box-sizing: border-box;
36
36
  min-height: 100%;
37
- background-color: var(--theme-background-color);
37
+ background-color: var(--theme-background-color, var(--white));
38
38
 
39
39
  *,
40
40
  *:before,
@@ -19,9 +19,9 @@
19
19
  }
20
20
 
21
21
  &&__default {
22
- --_an-a-fc: var(--theme-link-color);
23
- --_an-a-fc-hover: var(--theme-link-color-hover);
24
- --_an-a-fc-visited: var(--theme-link-color-visited);
22
+ --_an-a-fc: var(--theme-link-color, var(--theme-secondary-400));
23
+ --_an-a-fc-hover: var(--theme-link-color-hover, var(--theme-secondary-400));
24
+ --_an-a-fc-visited: var(--theme-link-color-visited, var(--theme-secondary-500));
25
25
  }
26
26
 
27
27
  &&__grayscale {
@@ -44,6 +44,6 @@ describe("anchors", () => {
44
44
  <div data-testid="${testid}" class="s-card ws3 fc-green-500">
45
45
  ${testid}: ${component}
46
46
  </div>
47
- `
47
+ `,
48
48
  });
49
49
  });
@@ -46,6 +46,6 @@ describe("avatar", () => {
46
46
  >
47
47
  ${component}
48
48
  </div>
49
- `
49
+ `,
50
50
  });
51
51
  });
@@ -37,8 +37,8 @@
37
37
  inset: 0 0 auto 0;
38
38
  padding: var(--su12);
39
39
  position: fixed;
40
- -webkit-transform: translate3d(0, calc(var(--theme-topbar-height) * var(--_no-x-offset)), 0);
41
- transform: translate3d(0, calc(var(--theme-topbar-height) * var(--_no-x-offset)), 0);
40
+ -webkit-transform: translate3d(0, calc(var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8))) * var(--_no-x-offset)), 0);
41
+ transform: translate3d(0, calc(var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8))) * var(--_no-x-offset)), 0);
42
42
  width: 100%;
43
43
  z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
44
44
  }
@@ -21,6 +21,6 @@ describe("button", () => {
21
21
  children: {
22
22
  default: "Ask question",
23
23
  },
24
- tag: "button"
24
+ tag: "button",
25
25
  });
26
26
  });
@@ -4,41 +4,41 @@
4
4
  --_bu-bc: transparent;
5
5
  // --_bu-bg: inherit; // [1]
6
6
  --_bu-br: var(--br-md);
7
- --_bu-fc: var(--theme-button-color);
7
+ --_bu-fc: var(--theme-button-color, var(--theme-secondary-400));
8
8
  --_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring);
9
9
  --_bu-fs: var(--fs-body1);
10
10
  --_bu-p: 0.8em;
11
11
  // STATE AND INTERACTION CUSTOM PROPERTIES
12
12
  --_bu-bc-selected: transparent;
13
- --_bu-bg-active: var(--theme-button-active-background-color);
14
- --_bu-bg-hover: var(--theme-button-hover-background-color);
15
- --_bu-bg-selected: var(--theme-button-selected-background-color);
16
- --_bu-fc-active: var(--theme-button-hover-color); // Note: hover color used here intentionally
17
- --_bu-fc-hover: var(--theme-button-hover-color);
18
- --_bu-fc-selected: var(--theme-button-selected-color);
13
+ --_bu-bg-active: var(--theme-button-active-background-color, var(--theme-secondary-300));
14
+ --_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-200));
15
+ --_bu-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
16
+ --_bu-fc-active: var(--theme-button-hover-color, var(--theme-secondary-500)); // Note: hover color used here intentionally
17
+ --_bu-fc-hover: var(--theme-button-hover-color, var(--theme-secondary-500));
18
+ --_bu-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
19
19
  // Filled
20
20
  --_bu-filled-bc: transparent;
21
21
  --_bu-filled-bc-active: transparent;
22
22
  --_bu-filled-bc-selected: transparent;
23
- --_bu-filled-bg: var(--theme-button-primary-background-color);
24
- --_bu-filled-bg-active: var(--theme-button-primary-active-background-color);
25
- --_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color);
26
- --_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color);
27
- --_bu-filled-fc: var(--theme-button-primary-color);
28
- --_bu-filled-fc-active: var(--theme-button-primary-hover-color);
29
- --_bu-filled-fc-hover: var(--theme-button-primary-hover-color);
30
- --_bu-filled-fc-selected: var(--theme-button-primary-selected-color);
23
+ --_bu-filled-bg: var(--theme-button-primary-background-color, var(--theme-secondary-400));
24
+ --_bu-filled-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
25
+ --_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
26
+ --_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
27
+ --_bu-filled-fc: var(--theme-button-primary-color, var(--white));
28
+ --_bu-filled-fc-active: var(--theme-button-primary-hover-color, var(--white));
29
+ --_bu-filled-fc-hover: var(--theme-button-primary-hover-color, var(--white));
30
+ --_bu-filled-fc-selected: var(--theme-button-primary-selected-color, var(--white));
31
31
  // Outlined
32
- --_bu-outlined-bc: var(--theme-button-outlined-border-color);
32
+ --_bu-outlined-bc: var(--theme-button-outlined-border-color, var(----theme-secondary-400));
33
33
  --_bu-outlined-bg: var(--theme-button-outlined-background-color);
34
- --_bu-outlined-bc-selected: var(--theme-button-outlined-selected-border-color);
35
- --_bu-outlined-bg-selected: var(--theme-button-selected-background-color);
36
- --_bu-outlined-fc-selected: var(--theme-button-selected-color);
34
+ --_bu-outlined-bc-selected: var(--theme-button-outlined-selected-border-color, var(----theme-secondary-400));
35
+ --_bu-outlined-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
36
+ --_bu-outlined-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
37
37
  // CHILD COMPONENT CUSTOM PROPERTIES
38
38
  --_bu-badge-o: 0.5;
39
39
  --_bu-dropdown-bw: var(--su-static4);
40
40
  --_bu-number-fc: var(--white);
41
- --_bu-number-fc-filled: var(--theme-button-primary-number-color);
41
+ --_bu-number-fc-filled: var(--theme-button-primary-number-color, var(--theme-secondary-600));
42
42
  --_bu-number-fc-selected: var(--white);
43
43
 
44
44
  // CONTEXTUAL STYLES
@@ -49,7 +49,7 @@
49
49
  --_bu-fc-selected: var(--white);
50
50
  --_bu-outlined-fc-selected: var(--white);
51
51
  --_bu-badge-o: 0.8;
52
- --_bu-number-fc-selected: var(--theme-button-primary-number-color);
52
+ --_bu-number-fc-selected: var(--theme-button-primary-number-color, var(--theme-secondary-600));
53
53
  });
54
54
 
55
55
  // STATES
@@ -306,16 +306,16 @@
306
306
 
307
307
  // DEPRECATED - THE PRIMARY BUTTON STYLE IS TO BE REMOVED WITH V1 COLORS
308
308
  &&__primary {
309
- --_bu-bg: var(--theme-button-primary-background-color);
310
- --_bu-bg-active: var(--theme-button-primary-active-background-color);
311
- --_bu-bg-hover: var(--theme-button-primary-hover-background-color);
312
- --_bu-bg-selected: var(--theme-button-primary-selected-background-color);
313
- --_bu-fc: var(--theme-button-primary-color);
314
- --_bu-fc-active: var(--theme-button-primary-hover-color);
315
- --_bu-fc-hover: var(--theme-button-primary-hover-color);
316
- --_bu-fc-selected: var(--theme-button-primary-selected-color);
317
- --_bu-number-fc: var(--theme-button-primary-number-color);
318
- --_bu-number-fc-selected: var(--theme-button-primary-number-color);
309
+ --_bu-bg: var(--theme-button-primary-background-color, var(--theme-secondary-400));
310
+ --_bu-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
311
+ --_bu-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
312
+ --_bu-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
313
+ --_bu-fc: var(--theme-button-primary-color, var(--white));
314
+ --_bu-fc-active: var(--theme-button-primary-hover-color, var(--white));
315
+ --_bu-fc-hover: var(--theme-button-primary-hover-color, var(--white));
316
+ --_bu-fc-selected: var(--theme-button-primary-selected-color, var(--white));
317
+ --_bu-number-fc: var(--theme-button-primary-number-color, var(--theme-secondary-600));
318
+ --_bu-number-fc-selected: var(--theme-button-primary-number-color, var(--theme-secondary-600));
319
319
 
320
320
  .highcontrast-mode({
321
321
  --_bu-bc: transparent;
@@ -44,6 +44,6 @@ describe("button", () => {
44
44
  >
45
45
  ${component}
46
46
  </div>
47
- `
47
+ `,
48
48
  });
49
49
  });
@@ -0,0 +1,30 @@
1
+ import { defaultOptions, runComponentTests } from "../../test/test-utils";
2
+ import highlightedFixtures from "./code-block.fixtures";
3
+ import "../../index";
4
+
5
+ describe("code block", () => {
6
+ Object.keys(highlightedFixtures).forEach((language) => {
7
+ runComponentTests({
8
+ type: "a11y",
9
+ tag: "pre",
10
+ baseClass: `s-code-block language-${language}`,
11
+ children: {
12
+ default: highlightedFixtures[language],
13
+ },
14
+ options: {
15
+ ...defaultOptions,
16
+ includeNullModifier: false,
17
+ },
18
+ // TODO new colors should resolve this issue
19
+ skippedTestids: [
20
+ "s-code-block-language-html-light",
21
+ "s-code-block-language-html-highcontrast-light",
22
+ "s-code-block-language-html-highcontrast-dark",
23
+ "s-code-block-language-html-dark",
24
+ "s-code-block-language-css-dark",
25
+ "s-code-block-language-javascript-dark",
26
+ "s-code-block-language-javascript-highcontrast-light",
27
+ ],
28
+ });
29
+ });
30
+ });
@@ -0,0 +1,88 @@
1
+ import type { LanguageFn } from "highlight.js";
2
+ import hljs from "highlight.js/lib/core";
3
+ import hljsJavascript from "highlight.js/lib/languages/javascript";
4
+ import hljsCss from "highlight.js/lib/languages/css";
5
+ import hljsHtml from "highlight.js/lib/languages/xml";
6
+
7
+ const hljsLanguages: Record<string, LanguageFn> = {
8
+ javascript: hljsJavascript,
9
+ css: hljsCss,
10
+ html: hljsHtml,
11
+ };
12
+
13
+ const javascriptFixture = `
14
+ import React, { Component } from 'react'
15
+ import { IP } from '../constants/IP'
16
+ import { withAuth0 } from '@auth0/auth0-react';
17
+
18
+ class AddATournament extends Component {
19
+ componentDidMount() {
20
+ this.myNewListOfAllTournamentsWithAuth()
21
+ }
22
+ }
23
+
24
+ export default withAuth0(AddATournament);
25
+ `;
26
+
27
+ const cssFixture = `
28
+ .s-input,
29
+ .s-textarea {
30
+ -webkit-appearance: none;
31
+ width: 100%;
32
+ margin: 0;
33
+ padding: 0.6em 0.7em;
34
+ border: 1px solid var(--bc-darker);
35
+ border-radius: 3px;
36
+ background-color: var(--white);
37
+ color: var(--fc-dark);
38
+ font-size: 13px;
39
+ font-family: inherit;
40
+ line-height: 1.15384615;
41
+ scrollbar-color: var(--scrollbar) transparent;
42
+ }
43
+ @supports (-webkit-overflow-scrolling: touch) {
44
+ .s-input,
45
+ .s-textarea {
46
+ font-size: 16px;
47
+ padding: 0.36em 0.55em;
48
+ }
49
+ .s-input::-webkit-input-placeholder,
50
+ .s-textarea::-webkit-input-placeholder {
51
+ line-height: normal !important;
52
+ }
53
+ }
54
+ `;
55
+
56
+ const htmlFixture = `
57
+ <form class="d-flex gy4 fd-column">
58
+ <label class="flex--item s-label" for="question-title">Question title</label>
59
+ <div class="d-flex ps-relative">
60
+ <input class="flex--item s-input" type="text" id="question-title" placeholder="e.g. Why doesn’t Stack Overflow use a custom web font?"/>
61
+ </div>
62
+ </form>
63
+ `;
64
+
65
+ const fixtures: Record<string, string> = {
66
+ javascript: javascriptFixture,
67
+ css: cssFixture,
68
+ html: htmlFixture,
69
+ };
70
+
71
+ const highlightFixture = (fixture: string, language: string) => {
72
+ const hljsLanguage = hljsLanguages[language];
73
+ hljs.registerLanguage(language, hljsLanguage);
74
+
75
+ const highlightedCode = hljs.highlight(fixture, { language }).value;
76
+
77
+ return `<code>${highlightedCode}</code>`;
78
+ };
79
+
80
+ const highlightedFixtures = Object.keys(fixtures).reduce(
81
+ (acc, language) => {
82
+ acc[language] = highlightFixture(fixtures[language], language);
83
+ return acc;
84
+ },
85
+ {} as Record<string, string>
86
+ );
87
+
88
+ export default highlightedFixtures;
@@ -0,0 +1,20 @@
1
+ import { defaultOptions, runComponentTests } from "../../test/test-utils";
2
+ import highlightedFixtures from "./code-block.fixtures";
3
+ import "../../index";
4
+
5
+ describe("code block", () => {
6
+ Object.keys(highlightedFixtures).forEach((language) => {
7
+ runComponentTests({
8
+ type: "visual",
9
+ tag: "pre",
10
+ baseClass: `s-code-block language-${language}`,
11
+ children: {
12
+ default: highlightedFixtures[language],
13
+ },
14
+ options: {
15
+ ...defaultOptions,
16
+ includeNullModifier: false,
17
+ },
18
+ });
19
+ });
20
+ });
@@ -2,9 +2,9 @@
2
2
  // it's tech debt that'll take some doing in consumer's code to pay down.
3
3
  a,
4
4
  .s-link {
5
- --_li-fc: var(--theme-link-color);
6
- --_li-fc-hover: var(--theme-link-color-hover);
7
- --_li-fc-visited: var(--theme-link-color-visited);
5
+ --_li-fc: var(--theme-link-color, var(--theme-secondary-400));
6
+ --_li-fc-hover: var(--theme-link-color-hover, var(--theme-secondary-400));
7
+ --_li-fc-visited: var(--theme-link-color-visited, var(--theme-secondary-500));
8
8
 
9
9
  // CONTEXTUAL STYLES
10
10
  .highcontrast-mode({
@@ -53,9 +53,9 @@ a,
53
53
  }
54
54
 
55
55
  &__visited { // TODO can we get rid of this? It's only in 3 places in Core and seems to me it doesn't even serve a purpose.
56
- --_li-fc: var(--theme-link-color-visited);
57
- --_li-fc-hover: var(--theme-link-color-hover);
58
- --_li-fc-visited: var(--theme-link-color-visited);
56
+ --_li-fc: var(--theme-link-color-visited, var(--theme-secondary-500));
57
+ --_li-fc-hover: var(--theme-link-color-hover, var(--theme-secondary-400));
58
+ --_li-fc-visited: var(--theme-link-color-visited, var(--theme-secondary-500));
59
59
  }
60
60
 
61
61
  // VARIANTS
@@ -109,7 +109,7 @@
109
109
  &:hover{
110
110
  &,
111
111
  &.s-link__visited {
112
- color: var(--theme-link-color-hover);
112
+ color: var(--theme-link-color-hover, var(--theme-secondary-400));
113
113
  }
114
114
  }
115
115
 
@@ -126,10 +126,10 @@
126
126
  }
127
127
 
128
128
  &.s-link__visited:visited {
129
- color: var(--theme-link-color);
129
+ color: var(--theme-link-color, var(--theme-secondary-400));
130
130
  }
131
131
 
132
- color: var(--theme-link-color);
132
+ color: var(--theme-link-color, var(--theme-secondary-400));
133
133
  cursor: pointer;
134
134
  text-decoration: none;
135
135
  }