@geoffcox/sterling-svelte-themes 2.0.16 → 2.0.17

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.
package/README.md CHANGED
@@ -22,6 +22,10 @@ https://github.com/GeoffCox/sterling-svelte-themes
22
22
 
23
23
  ## Change Log
24
24
 
25
+ ### 2.0.17
26
+
27
+ - Fixed Checkbox and Radio button layout styling to avoid absolute positioning from obscuring mouse events.
28
+
25
29
  ### 2.0.16
26
30
 
27
31
  - Added style support for Dialog not having a form element that wraps content.
@@ -1,6 +1,7 @@
1
1
  .sterling-checkbox {
2
2
  align-content: center;
3
3
  align-items: center;
4
+ column-gap: 0.25em;
4
5
  box-sizing: border-box;
5
6
  display: inline-flex;
6
7
  font: inherit;
@@ -16,11 +17,17 @@ The container
16
17
  - prevents collisions with surrounding slots
17
18
  */
18
19
  .sterling-checkbox .container {
20
+ box-sizing: border-box;
19
21
  font: inherit;
20
- position: relative;
21
22
  display: grid;
22
- align-items: center;
23
- margin-right: 0.25em;
23
+ grid-template-columns: 1fr;
24
+ grid-template-rows: 1fr;
25
+ place-content: stretch;
26
+ place-items: stretch;
27
+ }
28
+
29
+ .sterling-checkbox .container > * {
30
+ grid-area: 1 / 1;
24
31
  }
25
32
 
26
33
  /*
@@ -31,10 +38,7 @@ The input is hidden since the built-in browser checkbox cannot be customized
31
38
  font: inherit;
32
39
  margin: 0;
33
40
  padding: 0;
34
- position: absolute;
35
41
  opacity: 0;
36
- height: 20px;
37
- width: 20px;
38
42
  }
39
43
 
40
44
  /*
@@ -51,12 +55,12 @@ and there is not a parent CSS selector.
51
55
  display: inline-block;
52
56
  height: 20px;
53
57
  position: relative;
58
+ pointer-events: none;
54
59
  transition:
55
60
  background-color 250ms,
56
61
  color 250ms,
57
62
  border-color 250ms;
58
63
  width: 20px;
59
- pointer-events: none;
60
64
  }
61
65
 
62
66
  .sterling-checkbox:not(.disabled) input:checked + .indicator {
@@ -1,20 +1,13 @@
1
1
  .sterling-checkbox.button {
2
- align-content: center;
3
- align-items: center;
4
- appearance: none;
5
- background-color: transparent;
6
- border-color: transparent;
7
- border-style: solid;
8
- border-width: var(--stsv-button__border-width);
9
- box-sizing: border-box;
2
+ background-color: var(--stsv-button__background-color);
3
+ column-gap: unset;
10
4
  color: var(--stsv-button__color);
11
5
  cursor: pointer;
12
- display: inline-flex;
13
- flex-direction: row;
14
- font: inherit;
15
- justify-content: center;
16
- justify-items: center;
17
- column-gap: 0.25em;
6
+ display: grid;
7
+ grid-template-columns: 1fr;
8
+ grid-template-rows: 1fr;
9
+ place-content: stretch;
10
+ place-items: stretch;
18
11
  overflow: hidden;
19
12
  padding: 0.5em 1em;
20
13
  /* position:relative contains the input since container is removed from layout */
@@ -29,14 +22,16 @@
29
22
  user-select: none;
30
23
  }
31
24
 
25
+ .sterling-checkbox.button > * {
26
+ grid-area: 1 / 1;
27
+ }
28
+
32
29
  .sterling-checkbox.button:not(.disabled):hover {
33
30
  background-color: var(--stsv-button__background-color--hover);
34
- border-color: transparent;
35
31
  }
36
32
 
37
33
  .sterling-checkbox.button:not(.checked):not(.disabled):active {
38
34
  background-color: var(--stsv-button__background-color--active);
39
- border-color: transparent;
40
35
  }
41
36
 
42
37
  .sterling-checkbox.button.checked:not(.disabled) {
@@ -50,20 +45,6 @@
50
45
  outline-width: 2px;
51
46
  }
52
47
 
53
- /* Remove the container from layout */
54
- .sterling-checkbox.button .container {
55
- display: contents;
56
- }
57
-
58
- .sterling-checkbox.button input {
59
- left: 0;
60
- top: 0;
61
- right: 0;
62
- bottom: 0;
63
- width: unset;
64
- height: unset;
65
- }
66
-
67
48
  .sterling-radio.button label {
68
49
  display: block;
69
50
  }
@@ -78,7 +59,6 @@
78
59
  .sterling-checkbox.button.disabled:focus-visible {
79
60
  cursor: not-allowed;
80
61
  background-color: var(--stsv-button__background-color--disabled);
81
- border-color: var(--stsv-button__border-color--disabled);
82
62
  color: var(--stsv-button__color--disabled);
83
63
  }
84
64
 
@@ -1,6 +1,7 @@
1
1
  .sterling-radio {
2
2
  align-content: center;
3
3
  align-items: center;
4
+ column-gap: 0.25em;
4
5
  box-sizing: border-box;
5
6
  display: inline-flex;
6
7
  font: inherit;
@@ -16,11 +17,16 @@
16
17
  */
17
18
  .sterling-radio .container {
18
19
  box-sizing: border-box;
19
- position: relative;
20
20
  font: inherit;
21
- display: flex;
22
- align-items: center;
23
- margin-right: 0.25em;
21
+ display: grid;
22
+ grid-template-columns: 1fr;
23
+ grid-template-rows: 1fr;
24
+ place-content: stretch;
25
+ place-items: stretch;
26
+ }
27
+
28
+ .sterling-radio .container > * {
29
+ grid-area: 1 / 1;
24
30
  }
25
31
 
26
32
  /*
@@ -31,10 +37,7 @@
31
37
  font: inherit;
32
38
  margin: 0;
33
39
  padding: 0;
34
- position: absolute;
35
40
  opacity: 0;
36
- height: 21px;
37
- width: 21px;
38
41
  }
39
42
 
40
43
  /*
@@ -1,12 +1,29 @@
1
1
  .sterling-radio.button {
2
+ background-color: var(--stsv-button__background-color);
3
+ column-gap: unset;
4
+ color: var(--stsv-button__color);
5
+ cursor: pointer;
2
6
  display: grid;
3
7
  grid-template-columns: 1fr;
4
8
  grid-template-rows: 1fr;
5
- justify-content: center;
6
- justify-items: center;
7
- border: 1px solid transparent;
9
+ place-content: stretch;
10
+ place-items: stretch;
11
+ overflow: hidden;
12
+ padding: 0.5em 1em;
8
13
  /* position:relative contains the input since container is removed from layout */
9
14
  position: relative;
15
+ text-decoration: none;
16
+ text-overflow: ellipsis;
17
+ transition:
18
+ background-color 250ms,
19
+ color 250ms,
20
+ border-color 250ms;
21
+ white-space: nowrap;
22
+ user-select: none;
23
+ }
24
+
25
+ .sterling-radio.button > * {
26
+ grid-area: 1 / 1;
10
27
  }
11
28
 
12
29
  .sterling-radio.button:not(.disabled):hover {
@@ -28,20 +45,6 @@
28
45
  outline-width: 2px;
29
46
  }
30
47
 
31
- /* Remove the container from layout */
32
- .sterling-radio.button .container {
33
- display: contents;
34
- }
35
-
36
- .sterling-radio.button input {
37
- left: 0;
38
- top: 0;
39
- right: 0;
40
- bottom: 0;
41
- width: unset;
42
- height: unset;
43
- }
44
-
45
48
  .sterling-radio.button label {
46
49
  display: block;
47
50
  }
@@ -50,8 +53,20 @@
50
53
  display: none;
51
54
  }
52
55
 
53
- .sterling-radio.button.disabled {
54
- background-color: var(--stsv-input__background-color--disabled);
56
+ .sterling-radio.button.disabled,
57
+ .sterling-radio.button.disabled:hover,
58
+ .sterling-radio.button.disabled:active,
59
+ .sterling-radio.button.disabled:focus-visible {
60
+ cursor: not-allowed;
61
+ background-color: var(--stsv-button__background-color--disabled);
62
+ color: var(--stsv-button__color--disabled);
63
+ }
64
+
65
+ .sterling-radio.button.checked.disabled,
66
+ .sterling-radio.button.checked.disabled:hover,
67
+ .sterling-radio.button.checked.disabled:active,
68
+ .sterling-radio.button.checked.disabled:focus-visible {
69
+ background-color: var(--stsv-input__background-color--selected);
55
70
  }
56
71
 
57
72
  .sterling-radio.button.disabled label {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoffcox/sterling-svelte-themes",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "author": "Geoff Cox",
5
5
  "description": "A modern theme for the sterling-svelte component library.",
6
6
  "license": "MIT",