@stackoverflow/stacks 1.6.7 → 1.7.1

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.
@@ -0,0 +1,80 @@
1
+ a.s-block-link,
2
+ .s-block-link {
3
+ @bl-bs: inset var(--_li-block-bs-offset-x, 3px) 0 0 var(--theme-primary-color);
4
+ --_bl-bg: transparent;
5
+ --_bl-fc: var(--black-600);
6
+ --_bl-fc-hover: var(--black-800);
7
+ --_bl-fc-visited: var(--_bl-fc);
8
+
9
+ // CONTEXTUAL STYLES
10
+ .dark-mode({
11
+ &.is-selected {
12
+ --_bl-bg: var(--black-025);
13
+ }
14
+ });
15
+
16
+ // STATES
17
+ &.is-selected {
18
+ --_bl-bg: var(--black-050);
19
+ --_bl-fc: var(--black-800);
20
+
21
+ font-weight: bold;
22
+ }
23
+
24
+ // MODIFIERS
25
+ &&__left,
26
+ &&__right {
27
+ &.is-selected {
28
+ &:focus:not(:focus-visible),
29
+ &:focus-visible {
30
+ outline: none;
31
+ }
32
+
33
+ &:focus-visible {
34
+ box-shadow: @bl-bs, 0 0 0 var(--su-static4) var(--focus-ring-muted);
35
+ }
36
+
37
+ box-shadow: @bl-bs;
38
+ }
39
+ }
40
+
41
+ &&__right {
42
+ &.is-selected {
43
+ --_li-block-bs-offset-x: -3px;
44
+ }
45
+ }
46
+
47
+ // VARIANTS
48
+ &&__danger {
49
+ --_bl-fc: var(--red-500);
50
+ --_bl-fc-hover: var(--red-700);
51
+ }
52
+
53
+ &:active,
54
+ &:hover {
55
+ &,
56
+ &:visited {
57
+ color: var(--_bl-fc-hover);
58
+ }
59
+ }
60
+
61
+ &:visited {
62
+ color: var(--_bl-fc-focus);
63
+ }
64
+
65
+ @focus-styles();
66
+ background-color: var(--_bl-bg); // [1]
67
+ color: var(--_bl-fc);
68
+
69
+ border-radius: 0; // [1]
70
+ border: none; // [1]
71
+ cursor: pointer; // [1]
72
+ display: block;
73
+ font-family: inherit; // [1]
74
+ line-height: inherit; // [1]
75
+ padding: var(--su6) var(--su12);
76
+ text-align: left; // [1]
77
+ width: 100%;
78
+ }
79
+
80
+ // [1] Normalize for when applying to a button
@@ -81,6 +81,8 @@
81
81
  margin-left: -23px;
82
82
  opacity: 0; // [2]
83
83
  }
84
+
85
+ padding-left: 2.2em;
84
86
  }
85
87
 
86
88
  &.is-selected,
@@ -452,6 +454,16 @@
452
454
  background-color: var(--_bu-bg-active);
453
455
  color: var(--_bu-fc-active);
454
456
  }
457
+
458
+ &:visited:not(:hover):not(:focus) {
459
+ &.s-btn__filled {
460
+ background-color: var(--_bu-filled-bg);
461
+ color: var(--_bu-filled-fc);
462
+ }
463
+
464
+ background-color: var(--_bu-bg);
465
+ color: var(--_bu-fc);
466
+ }
455
467
  }
456
468
 
457
469
  &:focus,
@@ -306,6 +306,10 @@ fieldset {
306
306
  cursor: pointer;
307
307
  }
308
308
 
309
+ input& {
310
+ flex-shrink: 0;
311
+ }
312
+
309
313
  // Disabled
310
314
  &[disabled] {
311
315
  opacity: var(--_o-disabled-static);
@@ -0,0 +1,112 @@
1
+ // TODO we *really* shouldn't be apply styles directly onto `<a>` like this, but
2
+ // it's tech debt that'll take some doing in comsumer's code to pay down.
3
+ a,
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);
8
+
9
+ // CONTEXTUAL STYLES
10
+ .highcontrast-mode({
11
+ text-decoration: underline;
12
+ });
13
+
14
+ // STATES
15
+ &.s-link {
16
+ &__danger,
17
+ &__grayscale,
18
+ &__inherit,
19
+ &__muted,
20
+ &__visited {
21
+ &:visited {
22
+ &:active,
23
+ &:hover {
24
+ color: var(--_li-fc-hover);
25
+ }
26
+
27
+ color: var(--_li-fc-visited);
28
+ }
29
+ }
30
+
31
+ // MODIFIERS
32
+ &__dropdown {
33
+ &:after {
34
+ border-width: var(--su-static4); // this needs to come before any below border modifications
35
+ border-bottom-width: 0;
36
+ border-color: currentColor transparent;
37
+ border-style: solid;
38
+ border-top-width: var(--su-static4);
39
+ content: "";
40
+ pointer-events: none;
41
+ position: absolute;
42
+ right: 0;
43
+ top: calc(50% - var(--su-static2));
44
+ z-index: var(--zi-active);
45
+ }
46
+
47
+ padding-right: 0.9em;
48
+ position: relative;
49
+ }
50
+
51
+ &__underlined {
52
+ text-decoration: underline !important;
53
+ }
54
+
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-hover: var(--theme-link-color-hover);
57
+ --_li-fc-visited: var(--theme-link-color-visited);
58
+ }
59
+
60
+ // VARIANTS
61
+ &__danger {
62
+ --_li-fc: var(--red-500);
63
+ --_li-fc-hover: var(--red-400);
64
+ --_li-fc-visited: var(--red-600);
65
+ }
66
+
67
+ &__grayscale {
68
+ --_li-fc: var(--black-800);
69
+ --_li-fc-hover: var(--black-900);
70
+ --_li-fc-visited: var(--black-700);
71
+ }
72
+
73
+ &__inherit {
74
+ --_li-fc: inherit !important;
75
+ --_li-fc-hover: inherit !important;
76
+ --_li-fc-visited: inherit !important;
77
+ }
78
+
79
+ &__muted {
80
+ --_li-fc: var(--black-500);
81
+ --_li-fc-hover: var(--black-600);
82
+ --_li-fc-visited: var(--black-700);
83
+ }
84
+ }
85
+
86
+ // INTERACTION
87
+ &:active,
88
+ &:hover {
89
+ color: var(--_li-fc-hover);
90
+ }
91
+
92
+ color: var(--_li-fc);
93
+ cursor: pointer;
94
+ text-decoration: none;
95
+ user-select: auto;
96
+ }
97
+
98
+ .s-link {
99
+ button& {
100
+ &:focus {
101
+ outline: none;
102
+ }
103
+
104
+ appearance: none;
105
+ background: transparent;
106
+ border: 0;
107
+ font-family: inherit;
108
+ line-height: inherit;
109
+ padding: 0;
110
+ user-select: auto;
111
+ }
112
+ }