@geoffcox/sterling-svelte-themes 2.0.15 → 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,15 @@ 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
+
29
+ ### 2.0.16
30
+
31
+ - Added style support for Dialog not having a form element that wraps content.
32
+ - CSS style fix: content: '' => content: ""
33
+
25
34
  ### 2.0.15
26
35
 
27
36
  - Fixed issue with checkbox and radio button styles to ensure hidden input
@@ -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 {
@@ -83,7 +87,7 @@ The checkmark is a rotated L centered in the box.
83
87
  border-style: solid;
84
88
  border-width: 0 3px 3px 0;
85
89
  box-sizing: border-box;
86
- content: '';
90
+ content: "";
87
91
  height: 14px;
88
92
  left: 50%;
89
93
  position: absolute;
@@ -91,8 +95,8 @@ The checkmark is a rotated L centered in the box.
91
95
  transform: translate(-50%, -50%) rotate(45deg);
92
96
  transform-origin: center;
93
97
  transition:
94
- border-color 250ms,
95
- opacity 150ms;
98
+ border-color 250ms,
99
+ opacity 150ms;
96
100
  width: 7px;
97
101
  opacity: 0;
98
102
  }
@@ -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
 
@@ -22,6 +22,7 @@
22
22
  opacity: 0;
23
23
  }
24
24
 
25
+ .sterling-dialog > .content,
25
26
  .sterling-dialog > form > .content {
26
27
  background-color: var(--stsv-common__background-color);
27
28
  border-color: var(--stsv-common__border-color);
@@ -40,14 +41,17 @@
40
41
  opacity: 0;
41
42
  }
42
43
 
44
+ .sterling-dialog.open > .content,
43
45
  .sterling-dialog.open > form > .content {
44
46
  opacity: 1;
45
47
  }
46
48
 
49
+ .sterling-dialog.closing > .content,
47
50
  .sterling-dialog.closing > form > .content {
48
51
  opacity: 0;
49
52
  }
50
53
 
54
+ .sterling-dialog > .content > .header,
51
55
  .sterling-dialog > form > .content > .header {
52
56
  background-color: var(--stsv-common__background-color--secondary);
53
57
  display: grid;
@@ -59,23 +63,28 @@
59
63
  column-gap: 1em;
60
64
  }
61
65
 
66
+ .sterling-dialog > .content > .header > .title,
62
67
  .sterling-dialog > form > .content > .header > .title {
63
68
  font-size: 1.4em;
64
69
  }
65
70
 
71
+ .sterling-dialog > .content > .header > .close,
66
72
  .sterling-dialog > form > .content > .header > .close {
67
73
  justify-self: flex-end;
68
74
  }
69
75
 
76
+ .sterling-dialog > .content > .header > .close .close-x,
70
77
  .sterling-dialog > form > .content > .header > .close .close-x {
71
78
  width: 1em;
72
79
  height: 1em;
73
80
  position: relative;
74
81
  }
75
82
 
83
+ .sterling-dialog > .content > .header > .close .close-x::before,
84
+ .sterling-dialog > .content > .header > .close .close-x::after,
76
85
  .sterling-dialog > form > .content > .header > .close .close-x::before,
77
86
  .sterling-dialog > form > .content > .header > .close .close-x::after {
78
- content: '';
87
+ content: "";
79
88
  position: absolute;
80
89
  width: 0.75em;
81
90
  height: 0.125em;
@@ -83,26 +92,31 @@
83
92
  top: 0.45em;
84
93
  }
85
94
 
95
+ .sterling-dialog > .content > .header > .close .close-x::before,
86
96
  .sterling-dialog > form > .content > .header > .close .close-x::before {
87
97
  transform: rotate(45deg);
88
98
  left: 0.125em;
89
99
  }
90
100
 
101
+ .sterling-dialog > .content > .header > .close .close-x::after,
91
102
  .sterling-dialog > form > .content > .header > .close .close-x::after {
92
103
  transform: rotate(-45deg);
93
104
  right: 0.125em;
94
105
  }
95
106
 
107
+ .sterling-dialog > .content > .body,
96
108
  .sterling-dialog > form > .content > .body {
97
109
  padding: 1em;
98
110
  }
99
111
 
112
+ .sterling-dialog > .content > .separator,
100
113
  .sterling-dialog > form > .content > .separator {
101
114
  background-color: var(--stsv-common__background-color--secondary);
102
115
  height: var(--stsv-common__border-width);
103
116
  margin: 0 0.25em;
104
117
  }
105
118
 
119
+ .sterling-dialog > .content > .footer,
106
120
  .sterling-dialog > form > .content > .footer {
107
121
  padding: 0.5em 1em;
108
122
  gap: 5px;
@@ -110,6 +124,7 @@
110
124
 
111
125
  @media (prefers-reduced-motion) {
112
126
  .sterling-dialog::backdrop,
127
+ .sterling-dialog > .content,
113
128
  .sterling-dialog > form > .content {
114
129
  transition: none;
115
130
  }
@@ -59,7 +59,7 @@
59
59
 
60
60
  .sterling-dropdown .chevron::after {
61
61
  position: absolute;
62
- content: '';
62
+ content: "";
63
63
  top: 50%;
64
64
  left: 50%;
65
65
  width: 7px;
@@ -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
  /*
@@ -80,7 +83,7 @@
80
83
  .sterling-radio .indicator::after {
81
84
  background-color: transparent;
82
85
  border-radius: 10000px;
83
- content: '';
86
+ content: "";
84
87
  height: 9px;
85
88
  left: 50%;
86
89
  position: absolute;
@@ -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 {
@@ -54,7 +54,7 @@
54
54
 
55
55
  .sterling-select .chevron::after {
56
56
  position: absolute;
57
- content: '';
57
+ content: "";
58
58
  top: 50%;
59
59
  left: 50%;
60
60
  width: 7px;
@@ -9,7 +9,7 @@
9
9
 
10
10
  .sterling-tree-chevron::after {
11
11
  position: absolute;
12
- content: '';
12
+ content: "";
13
13
  top: 50%;
14
14
  left: 50%;
15
15
  width: 7px;
@@ -62,7 +62,7 @@
62
62
 
63
63
  .sterling-tree-chevron.leaf::after {
64
64
  animation: none;
65
- content: '';
65
+ content: "";
66
66
  position: absolute;
67
67
  font: inherit;
68
68
  left: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoffcox/sterling-svelte-themes",
3
- "version": "2.0.15",
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",