contain-css-svelte 0.0.15 → 0.0.16
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/dist/controls/Button.svelte +5 -0
- package/dist/controls/Checkbox.svelte +33 -8
- package/dist/controls/Checkbox.svelte.d.ts +9 -2
- package/dist/controls/Input.svelte +13 -2
- package/dist/controls/MiniButton.svelte +5 -0
- package/dist/controls/RadioButton.svelte +28 -12
- package/dist/controls/Select.svelte +10 -2
- package/dist/controls/Slider.svelte +42 -33
- package/dist/controls/TabItem.svelte +6 -0
- package/dist/dropdowns/DropdownMenu.svelte +10 -0
- package/dist/layout/Accordion.svelte +27 -11
- package/dist/layout/FormItem.svelte +7 -0
- package/dist/layout/MenuList.svelte +5 -0
- package/dist/layout/Page.svelte +0 -5
- package/dist/layout/Sidebar.svelte +10 -0
- package/dist/layout/SplitPane.svelte +5 -0
- package/dist/layout/Tile.svelte +12 -1
- package/dist/overlays/Tooltip.svelte +1 -2
- package/dist/sass/_affordances.scss +118 -45
- package/dist/typography/TextLayout.svelte +20 -0
- package/dist/vars/colors.css +1 -0
- package/dist/vars/defaults.css +1 -1
- package/dist/vars/layout.css +0 -1
- package/dist/vars/themes/lightordark.css +76 -40
- package/dist/vars/themes/purple.css +1 -1
- package/package.json +61 -61
|
@@ -89,6 +89,11 @@ button:disabled {
|
|
|
89
89
|
transform: var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none)));
|
|
90
90
|
filter: var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5))));
|
|
91
91
|
}
|
|
92
|
+
button:focus-visible {
|
|
93
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
94
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
95
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
96
|
+
}
|
|
92
97
|
|
|
93
98
|
button.primary {
|
|
94
99
|
background: var(--primary-bg, var(--button-bg, var(--control-bg, var(--bg, unset))));
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<script>export let checked;
|
|
2
|
-
export let value;
|
|
3
|
-
export let group;
|
|
4
2
|
/* Styling properties */
|
|
5
3
|
import { injectVars } from "../util";
|
|
6
4
|
export let bg = null;
|
|
@@ -15,8 +13,11 @@ let style = injectVars($$props, "checkbox", [
|
|
|
15
13
|
"width",
|
|
16
14
|
"height",
|
|
17
15
|
]);
|
|
16
|
+
export let value = undefined;
|
|
17
|
+
// default group to an empty array so code that calls group.indexOf(...) won't throw
|
|
18
|
+
export let group = [];
|
|
18
19
|
let ref;
|
|
19
|
-
let labelContent;
|
|
20
|
+
let labelContent = "";
|
|
20
21
|
$: {
|
|
21
22
|
if (ref) {
|
|
22
23
|
labelContent = ref.innerHTML;
|
|
@@ -26,12 +27,23 @@ $: {
|
|
|
26
27
|
|
|
27
28
|
<div class="label-sizing-box">
|
|
28
29
|
<label class="checkbox-item">
|
|
29
|
-
<input
|
|
30
|
-
|
|
30
|
+
<input
|
|
31
|
+
type="checkbox"
|
|
32
|
+
bind:checked
|
|
33
|
+
bind:group
|
|
34
|
+
{value}
|
|
35
|
+
on:change
|
|
36
|
+
on:click
|
|
37
|
+
on:blur
|
|
38
|
+
on:focus
|
|
39
|
+
on:focusin
|
|
40
|
+
on:focusout
|
|
41
|
+
{...$$restProps}
|
|
42
|
+
/>
|
|
31
43
|
<span bind:this={ref}><slot /></span>
|
|
32
44
|
</label>
|
|
33
45
|
<label class="invisible">
|
|
34
|
-
<input type="checkbox" checked=
|
|
46
|
+
<input type="checkbox" checked={true} />
|
|
35
47
|
<span>{@html labelContent}</span>
|
|
36
48
|
</label>
|
|
37
49
|
</div>
|
|
@@ -97,7 +109,6 @@ label {
|
|
|
97
109
|
display: inline-flex;
|
|
98
110
|
align-items: center;
|
|
99
111
|
box-sizing: border-box;
|
|
100
|
-
user-select: none;
|
|
101
112
|
gap: var(--checkbox-space, var(--toggle-space, var(--space-md)));
|
|
102
113
|
cursor: var(--checkbox-cursor, var(--clickable-cursor, var(--cursor, pointer)));
|
|
103
114
|
transition: filter, transform var(--checkbox-transition, var(--clickable-transition, var(--transition, 300ms)));
|
|
@@ -125,7 +136,21 @@ label:has(input:checked) {
|
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
input[type=checkbox] {
|
|
128
|
-
|
|
139
|
+
position: absolute;
|
|
140
|
+
width: 1px;
|
|
141
|
+
height: 1px;
|
|
142
|
+
padding: 0;
|
|
143
|
+
margin: -1px;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
clip: rect(0 0 0 0);
|
|
146
|
+
clip-path: insert(50%);
|
|
147
|
+
border: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
label:has(input:focus-visible) {
|
|
151
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
152
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
153
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
129
154
|
}
|
|
130
155
|
|
|
131
156
|
label::before {
|
|
@@ -3,15 +3,22 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
checked: boolean;
|
|
6
|
-
value: any;
|
|
7
|
-
group: string;
|
|
8
6
|
bg?: string | null | undefined;
|
|
9
7
|
fg?: string | null | undefined;
|
|
10
8
|
padding?: string | null | undefined;
|
|
11
9
|
width?: string | null | undefined;
|
|
12
10
|
height?: string | null | undefined;
|
|
11
|
+
value?: any;
|
|
12
|
+
group?: any;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
|
+
change: Event;
|
|
16
|
+
click: MouseEvent;
|
|
17
|
+
blur: FocusEvent;
|
|
18
|
+
focus: FocusEvent;
|
|
19
|
+
focusin: FocusEvent;
|
|
20
|
+
focusout: FocusEvent;
|
|
21
|
+
} & {
|
|
15
22
|
[evt: string]: CustomEvent<any>;
|
|
16
23
|
};
|
|
17
24
|
slots: {
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
export let placeholder = "";
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<input
|
|
6
|
-
{
|
|
5
|
+
<input
|
|
6
|
+
{placeholder}
|
|
7
|
+
bind:value
|
|
8
|
+
on:input
|
|
9
|
+
on:change
|
|
10
|
+
on:blur
|
|
11
|
+
on:focus
|
|
12
|
+
{...$$restProps}
|
|
7
13
|
/>
|
|
8
14
|
|
|
9
15
|
<style>/* Warning: because we define a fallback
|
|
@@ -41,4 +47,9 @@ input {
|
|
|
41
47
|
--link-bg: var(--input-link-bg, var(--ui-link-bg, var(--ui-link-bg, inherit)));
|
|
42
48
|
--link-fg: var(--input-link-fg, var(--ui-link-fg, var(--ui-link-fg, inherit)));
|
|
43
49
|
width: var(--input-width);
|
|
50
|
+
}
|
|
51
|
+
input:focus-visible {
|
|
52
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
53
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
54
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
44
55
|
}</style>
|
|
@@ -90,6 +90,11 @@ button:disabled {
|
|
|
90
90
|
transform: var(--mini-button-disabled-transform, var(--button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none))));
|
|
91
91
|
filter: var(--mini-button-disabled-filter, var(--button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
92
92
|
}
|
|
93
|
+
button:focus-visible {
|
|
94
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
95
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
96
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
97
|
+
}
|
|
93
98
|
|
|
94
99
|
button.primary {
|
|
95
100
|
background: var(--primary-bg, var(--button-bg, var(--control-bg, var(--bg, unset))));
|
|
@@ -25,11 +25,12 @@ $: {
|
|
|
25
25
|
|
|
26
26
|
<div class="label-sizing-box">
|
|
27
27
|
<label class="radio-item">
|
|
28
|
-
<input {value} type="radio" bind:group
|
|
29
|
-
{...$$restProps}/>
|
|
28
|
+
<input {value} type="radio" bind:group {...$$restProps} />
|
|
30
29
|
<span bind:this={ref}><slot /></span>
|
|
31
30
|
</label>
|
|
32
|
-
|
|
31
|
+
<!-- Hidden label determines how much space we occupy -- that way we can apply e.g. bold font without
|
|
32
|
+
reflowing the UI when checked/unchecked -->
|
|
33
|
+
<label class="invisible radio-item">
|
|
33
34
|
<input type="radio" checked="true" />
|
|
34
35
|
<span>{@html labelContent}</span>
|
|
35
36
|
</label>
|
|
@@ -90,7 +91,7 @@ label {
|
|
|
90
91
|
position: absolute;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
label {
|
|
94
|
+
label.radio-item {
|
|
94
95
|
display: inline-flex;
|
|
95
96
|
align-items: center;
|
|
96
97
|
box-sizing: border-box;
|
|
@@ -100,33 +101,48 @@ label {
|
|
|
100
101
|
cursor: var(--radio-button-cursor, var(--clickable-cursor, var(--cursor, pointer)));
|
|
101
102
|
transition: filter, transform var(--radio-button-transition, var(--clickable-transition, var(--transition, 300ms)));
|
|
102
103
|
}
|
|
103
|
-
label:hover {
|
|
104
|
+
label.radio-item:hover {
|
|
104
105
|
filter: var(--radio-button-hover-filter, var(--clickable-hover-filter, var(--hover-filter, brightness(1.4))));
|
|
105
106
|
transform: var(--radio-button-hover-transform, var(--clickable-hover-transform, var(--hover-transform, none)));
|
|
106
107
|
}
|
|
107
|
-
label:active {
|
|
108
|
+
label.radio-item:active {
|
|
108
109
|
filter: var(--radio-button-active-filter, var(--clickable-active-filter, var(--active-filter, brightness(0.9))));
|
|
109
110
|
transform: var(--radio-button-active-transform, var(--clickable-active-transform, var(--active-transform, none)));
|
|
110
111
|
}
|
|
111
|
-
label:disabled {
|
|
112
|
+
label.radio-item:disabled {
|
|
112
113
|
cursor: var(--radio-button-disabled-cursor, var(--clickable-disabled-cursor, var(--disabled-cursor, not-allowed)));
|
|
113
114
|
transform: var(--radio-button-disabled-transform, var(--clickable-disabled-transform, var(--disabled-transform, none)));
|
|
114
115
|
filter: var(--radio-button-disabled-filter, var(--clickable-disabled-filter, var(--disabled-filter, grayscale(0.5))));
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
label span {
|
|
118
|
+
label.radio-item span {
|
|
118
119
|
width: var(--label-width);
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
label:has(input:checked) {
|
|
122
|
+
label.radio-item:has(input:checked) {
|
|
122
123
|
font-weight: var(--radio-button-checked-weight, var(--checked-weight, var(--weight, active)));
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
input[type=radio] {
|
|
126
|
-
|
|
127
|
+
/* visually hidden but still accessible */
|
|
128
|
+
position: absolute;
|
|
129
|
+
width: 1px;
|
|
130
|
+
height: 1px;
|
|
131
|
+
padding: 0;
|
|
132
|
+
margin: -1px;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
clip: rect(0 0 0 0);
|
|
135
|
+
clip-path: insert(50%);
|
|
136
|
+
border: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
label.radio-item:has(input:focus-visible) {
|
|
140
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
141
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
142
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
127
143
|
}
|
|
128
144
|
|
|
129
|
-
label::before {
|
|
145
|
+
label.radio-item::before {
|
|
130
146
|
transition: all var(--radio-button-transition, var(--transition, control));
|
|
131
147
|
display: inline-grid;
|
|
132
148
|
place-content: center;
|
|
@@ -143,7 +159,7 @@ label::before {
|
|
|
143
159
|
margin-left: var(--radio-button-padding, var(--padding));
|
|
144
160
|
}
|
|
145
161
|
|
|
146
|
-
label:has(input:checked)::before {
|
|
162
|
+
label.radio-item:has(input:checked)::before {
|
|
147
163
|
background: var(--radio-button-checked-bg, var(--toggle-on-bg, var(--primary-bg, var(--bg, unset))));
|
|
148
164
|
color: var(--radio-button-checked-fg, var(--toggle-on-fg, var(--primary-fg, var(--fg, unset))));
|
|
149
165
|
--link-bg: var(--radio-button-checked-link-bg, var(--toggle-on-link-bg, var(--primary-link-bg, var(--primary-link-bg, inherit))));
|
|
@@ -17,10 +17,12 @@ onMount(async () => {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
if (selectElement) {
|
|
21
|
+
observer.observe(selectElement, { childList: true });
|
|
22
|
+
}
|
|
21
23
|
// Observe size changes in option buttons
|
|
22
24
|
resizeObserver = new ResizeObserver(() => updateTargetWidth());
|
|
23
|
-
optionButtons.forEach(button => resizeObserver.observe(button));
|
|
25
|
+
optionButtons.forEach((button) => resizeObserver.observe(button));
|
|
24
26
|
return () => {
|
|
25
27
|
observer.disconnect();
|
|
26
28
|
resizeObserver.disconnect();
|
|
@@ -137,6 +139,12 @@ select,
|
|
|
137
139
|
font-variant: var(--select-font-variant, var(--input-font-variant, var(--ui-font-variant, var(--font-variant, unset))));
|
|
138
140
|
text-align: var(--select-text-align, var(--input-text-align, var(--ui-text-align, var(--text-align, unset))));
|
|
139
141
|
}
|
|
142
|
+
select:focus-visible,
|
|
143
|
+
.dropdown-wrapper > :global(.dropdown-menu > button):focus-visible {
|
|
144
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
145
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
146
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
147
|
+
}
|
|
140
148
|
|
|
141
149
|
.select-dropdown-label {
|
|
142
150
|
overflow: hidden;
|
|
@@ -5,42 +5,51 @@
|
|
|
5
5
|
export let step = 1;
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<input type="range" bind:value {min} {max} {step}
|
|
9
|
-
{...$$restProps}/>
|
|
8
|
+
<input type="range" bind:value {min} {max} {step} {...$$restProps} />
|
|
10
9
|
|
|
11
|
-
<style
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<style>/* Warning: because we define a fallback
|
|
11
|
+
media query, the media query can override the container
|
|
12
|
+
if we stack a bunch of these in a row and aren't thoughtful about the order.
|
|
13
|
+
Put min-width queries *after* max-width queries so that smaller
|
|
14
|
+
container queries don't get their styles overridden by large media queries.
|
|
15
|
+
*/
|
|
16
|
+
/* Convenience groupings */
|
|
17
|
+
:root {
|
|
18
|
+
--slider-button-color: var(--primary-bg);
|
|
19
|
+
--slider-button-radius: 50%;
|
|
20
|
+
--slider-line-color: var(--fg);
|
|
21
|
+
/* Add more variables and styles as needed */
|
|
22
|
+
}
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
input[type=range] {
|
|
25
|
+
/* Apply your custom styles here */
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
28
|
+
input[type=range]:focus-visible {
|
|
29
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
30
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
31
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
32
|
+
}
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
/* Slider Thumb */
|
|
35
|
+
input[type=range]::-webkit-slider-thumb {
|
|
36
|
+
-webkit-appearance: none;
|
|
37
|
+
background: var(--slider-button-color);
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
width: 18px;
|
|
40
|
+
/* More styles for the thumb */
|
|
41
|
+
}
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
input[type=range]::-moz-range-thumb {
|
|
44
|
+
/* Styles for Firefox */
|
|
45
|
+
}
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
/* Slider Track */
|
|
48
|
+
input[type=range]::-webkit-slider-runnable-track {
|
|
49
|
+
background: var(--slider-line-color);
|
|
50
|
+
/* More styles for the track */
|
|
51
|
+
}
|
|
42
52
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</style>
|
|
53
|
+
input[type=range]::-moz-range-track {
|
|
54
|
+
/* Styles for Firefox */
|
|
55
|
+
}</style>
|
|
@@ -54,6 +54,12 @@ div > :global(div > button) {
|
|
|
54
54
|
border-radius: var(--tab-border-radius, var(--border-radius) var(--border-radius) 0 0);
|
|
55
55
|
margin: 0;
|
|
56
56
|
}
|
|
57
|
+
div > :global(button):focus-visible,
|
|
58
|
+
div > :global(div > button):focus-visible {
|
|
59
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
60
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
61
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
62
|
+
}
|
|
57
63
|
|
|
58
64
|
div.active > :global(button),
|
|
59
65
|
div.active > :global(div > button) {
|
|
@@ -176,6 +176,11 @@ button:disabled {
|
|
|
176
176
|
transform: var(--menu-disabled-transform, var(--button-disabled-transform, var(--control-disabled-transform, var(--disabled-transform, none))));
|
|
177
177
|
filter: var(--menu-disabled-filter, var(--button-disabled-filter, var(--control-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
178
178
|
}
|
|
179
|
+
button:focus-visible {
|
|
180
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
181
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
182
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
183
|
+
}
|
|
179
184
|
|
|
180
185
|
.menu {
|
|
181
186
|
background: var(--menu-bg, var(--container-bg, var(--bg, unset)));
|
|
@@ -220,6 +225,11 @@ button:disabled {
|
|
|
220
225
|
transform: var(--menu-disabled-transform, var(--button-disabled-transform, var(--control-disabled-transform, var(--disabled-transform, none))));
|
|
221
226
|
filter: var(--menu-disabled-filter, var(--button-disabled-filter, var(--control-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
222
227
|
}
|
|
228
|
+
.menu:focus-visible {
|
|
229
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
230
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
231
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
232
|
+
}
|
|
223
233
|
|
|
224
234
|
.dropdown-menu {
|
|
225
235
|
font-family: var(--menu-font-family, var(--container-font-family, var(--font-family, unset)));
|
|
@@ -3,17 +3,29 @@ export let highlanderMode = true;
|
|
|
3
3
|
let wrapper;
|
|
4
4
|
function onAccordionClicked(e) {
|
|
5
5
|
if (!highlanderMode) {
|
|
6
|
-
console.log('Not in highlander mode, no click handler');
|
|
7
6
|
return;
|
|
8
7
|
}
|
|
9
8
|
const target = e.target;
|
|
9
|
+
// Ensure the click is within the current accordion wrapper
|
|
10
|
+
if (target.closest(".accordion-wrapper") !== wrapper) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
// Check if the clicked element is a <summary>
|
|
10
14
|
if (target.tagName === "SUMMARY") {
|
|
11
|
-
// If we clicked summary -- make sure to close the others
|
|
12
15
|
const details = target.parentElement;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
// Check if this <details> is nested inside another <details>
|
|
17
|
+
const parentDetails = details.parentElement?.closest("details");
|
|
18
|
+
if (parentDetails &&
|
|
19
|
+
parentDetails.closest(".accordion-wrapper") === wrapper) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Close all other <details> within the same wrapper
|
|
23
|
+
const allDetails = wrapper.querySelectorAll("details");
|
|
24
|
+
allDetails.forEach((d) => {
|
|
25
|
+
if (d !== details) {
|
|
26
|
+
if (d.closest(".accordion-wrapper") === wrapper) {
|
|
27
|
+
d.open = false;
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
});
|
|
19
31
|
}
|
|
@@ -28,8 +40,7 @@ function onAccordionClicked(e) {
|
|
|
28
40
|
<slot />
|
|
29
41
|
</div>
|
|
30
42
|
|
|
31
|
-
<style
|
|
32
|
-
/* Warning: because we define a fallback
|
|
43
|
+
<style>/* Warning: because we define a fallback
|
|
33
44
|
media query, the media query can override the container
|
|
34
45
|
if we stack a bunch of these in a row and aren't thoughtful about the order.
|
|
35
46
|
Put min-width queries *after* max-width queries so that smaller
|
|
@@ -132,6 +143,11 @@ div :global(details > summary):disabled {
|
|
|
132
143
|
transform: var(--accordion-disabled-transform, var(--disabled-transform, none));
|
|
133
144
|
filter: var(--accordion-disabled-filter, var(--disabled-filter, grayscale(0.5)));
|
|
134
145
|
}
|
|
146
|
+
div :global(details > summary):focus-visible {
|
|
147
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
148
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
149
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
150
|
+
}
|
|
135
151
|
|
|
136
152
|
div :global(details[open] > summary) {
|
|
137
153
|
background: var(--accordion-summary-open-bg, var(--primary-bg, var(--bg, unset)));
|
|
@@ -188,12 +204,12 @@ div :global(summary) {
|
|
|
188
204
|
}
|
|
189
205
|
|
|
190
206
|
div :global(summary::after) {
|
|
191
|
-
content: var(--accordion-icon, "
|
|
207
|
+
content: var(--accordion-icon, "+");
|
|
192
208
|
float: right;
|
|
193
209
|
transition: transform 0.3s;
|
|
194
210
|
}
|
|
195
211
|
|
|
196
212
|
div :global(details[open] > summary::after) {
|
|
197
|
-
transform: var(--accordion-icon-transform,
|
|
198
|
-
content: var(--accordion-open-icon, var(--accordion-icon, "
|
|
213
|
+
transform: var(--accordion-icon-transform, rotateZ(45deg));
|
|
214
|
+
content: var(--accordion-open-icon, var(--accordion-icon, "+"));
|
|
199
215
|
}</style>
|
|
@@ -122,4 +122,11 @@ label {
|
|
|
122
122
|
border-left: var(--form-input-border-left, var(--input-border-left, var(--ui-border-left, var(--border-left, var(--form-input-border, var(--input-border, var(--ui-border, var(--border, none))))))));
|
|
123
123
|
padding: var(--form-input-padding, var(--input-padding, var(--ui-padding, var(--padding, 4px))));
|
|
124
124
|
border-radius: var(--form-input-square-radius, var(--input-square-radius, var(--ui-square-radius, var(--square-radius, 0))));
|
|
125
|
+
}
|
|
126
|
+
.globalInputStyles :global(input):focus-visible,
|
|
127
|
+
.globalInputStyles :global(select):focus-visible,
|
|
128
|
+
.globalInputStyles :global(textarea):focus-visible {
|
|
129
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
130
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
131
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
125
132
|
}</style>
|
|
@@ -106,6 +106,11 @@ let style = injectVars($$props, "menu", [
|
|
|
106
106
|
border-radius: var(--menu-item-square-radius, var(--button-square-radius, var(--control-square-radius, var(--square-radius, 0))));
|
|
107
107
|
/* @include clickable(menu-item); */
|
|
108
108
|
}
|
|
109
|
+
.menu :global(a):focus-visible, .menu :global(button):focus-visible, .menu :global(input[type="submit"]):focus-visible, .menu :global(.button):focus-visible {
|
|
110
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
111
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
112
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
113
|
+
}
|
|
109
114
|
.menu :global(.active) {
|
|
110
115
|
background: var(--menu-item-active-bg, var(--primary-bg, var(--menu-item-bg, var(--button-bg, var(--control-bg, var(--container-bg, var(--bg, unset)))))));
|
|
111
116
|
color: var(--menu-item-active-fg, var(--primary-fg, var(--menu-item-fg, var(--button-fg, var(--control-fg, var(--container-fg, var(--fg, unset)))))));
|
package/dist/layout/Page.svelte
CHANGED
|
@@ -23,7 +23,6 @@ let hasFooter;
|
|
|
23
23
|
$: hasSidebar = $$slots.sidebar && !hideSidebar;
|
|
24
24
|
$: hasHeader = $$slots.header && !hideHeader;
|
|
25
25
|
$: hasFooter = $$slots.footer && !hideFooter;
|
|
26
|
-
$: console.log("Update to flags: header,footer,sidebar=", hasHeader, hasFooter, hasSidebar);
|
|
27
26
|
// Start "unfrozen" so i.e. scrolling on reload
|
|
28
27
|
// or hash link works properly
|
|
29
28
|
let freeze = false;
|
|
@@ -38,18 +37,14 @@ function handleScroll() {
|
|
|
38
37
|
const computedTopStyle = getComputedStyle(pageElement).getPropertyValue("top");
|
|
39
38
|
const computedTop = parseFloat(computedTopStyle);
|
|
40
39
|
const isSticking = rect.top <= computedTop;
|
|
41
|
-
console.log("Freeze = ", !isSticking);
|
|
42
40
|
freeze = !isSticking;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
onMount(() => {
|
|
46
|
-
console.log("onMount is called!");
|
|
47
44
|
if (sticky) {
|
|
48
|
-
console.log("Add scroll handler in a sec");
|
|
49
45
|
if (window.location.hash) {
|
|
50
46
|
let el = document.querySelector(window.location.hash);
|
|
51
47
|
if (el) {
|
|
52
|
-
console.log("Hash", window.location.hash, "points to ", el);
|
|
53
48
|
el?.scrollIntoView();
|
|
54
49
|
}
|
|
55
50
|
}
|
|
@@ -150,6 +150,11 @@ aside .content::-webkit-scrollbar-thumb:hover {
|
|
|
150
150
|
padding: 0;
|
|
151
151
|
border: none;
|
|
152
152
|
}
|
|
153
|
+
.edge-bar button:focus-visible {
|
|
154
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
155
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
156
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
157
|
+
}
|
|
153
158
|
/* Affordances */
|
|
154
159
|
.edge-bar:hover {
|
|
155
160
|
filter: var(--grab-bar-hover-filter);
|
|
@@ -245,6 +250,11 @@ aside .content::-webkit-scrollbar-thumb:hover {
|
|
|
245
250
|
transform: var(--mini-button-disabled-transform, var(--button-disabled-transform, var(--control-disabled-transform, var(--disabled-transform, none))));
|
|
246
251
|
filter: var(--mini-button-disabled-filter, var(--button-disabled-filter, var(--control-disabled-filter, var(--disabled-filter, grayscale(0.5)))));
|
|
247
252
|
}
|
|
253
|
+
aside > button:focus-visible {
|
|
254
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
255
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
256
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
257
|
+
}
|
|
248
258
|
aside > button.close {
|
|
249
259
|
left: calc(var(--sidebar-width) - var(--icon-size, 32px) + var(--padding));
|
|
250
260
|
border-radius: var(--mini-button-radius, var(--button-radius, var(--radius, 50%)));
|
|
@@ -136,6 +136,11 @@ onMount(() => {
|
|
|
136
136
|
justify-content: center;
|
|
137
137
|
align-items: stretch;
|
|
138
138
|
}
|
|
139
|
+
.split-pane > .resizer:focus-visible {
|
|
140
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
141
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
142
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
143
|
+
}
|
|
139
144
|
|
|
140
145
|
.split-pane > .resizer::before {
|
|
141
146
|
content: " ";
|
package/dist/layout/Tile.svelte
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export let interactive = false; // Prop to make the tile clickable or not
|
|
3
3
|
export let selectable = false;
|
|
4
4
|
export let checked = false;
|
|
5
|
-
$: console.log("Checked=>", checked);
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
7
|
{#if selectable}
|
|
@@ -252,6 +251,12 @@ label.tile:disabled {
|
|
|
252
251
|
filter: var(--tile-disabled-filter, var(--disabled-filter, grayscale(0.5)));
|
|
253
252
|
}
|
|
254
253
|
|
|
254
|
+
button.tile:focus-visible {
|
|
255
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
256
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
257
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
258
|
+
}
|
|
259
|
+
|
|
255
260
|
label.tile {
|
|
256
261
|
background: var(--tile-selected-bg, var(--bg, unset));
|
|
257
262
|
color: var(--tile-selected-fg, var(--fg, unset));
|
|
@@ -273,6 +278,12 @@ label.tile {
|
|
|
273
278
|
text-align: var(--tile-selected-text-align, var(--text-align, unset));
|
|
274
279
|
}
|
|
275
280
|
|
|
281
|
+
label.tile:has(input:focus-visible) {
|
|
282
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
283
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
284
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
285
|
+
}
|
|
286
|
+
|
|
276
287
|
/* Sizing code */
|
|
277
288
|
.tile {
|
|
278
289
|
width: var(--tile-width, 200px);
|
|
@@ -40,7 +40,7 @@ function showPopover() {
|
|
|
40
40
|
tooltipDiv.style.marginTop = "var(--tooltipGap, 8px)";
|
|
41
41
|
}
|
|
42
42
|
else if (renderedVertical == "top") {
|
|
43
|
-
tooltipDiv.style.bottom = `${window.innerHeight -
|
|
43
|
+
tooltipDiv.style.bottom = `${window.innerHeight - targetRect.top}px`;
|
|
44
44
|
tooltipDiv.style.top = "unset";
|
|
45
45
|
tooltipDiv.style.marginBottom = "var(--tooltipGap, 8px)";
|
|
46
46
|
}
|
|
@@ -54,7 +54,6 @@ function showPopover() {
|
|
|
54
54
|
}
|
|
55
55
|
// Top and Left will put us OVER the element (matching top and left corner)
|
|
56
56
|
// Let's use the margin to adjust positioning...
|
|
57
|
-
console.log(tooltipDiv.style);
|
|
58
57
|
tooltipDiv.togglePopover(true);
|
|
59
58
|
}
|
|
60
59
|
</script>
|
|
@@ -1,51 +1,124 @@
|
|
|
1
|
+
@use "functions" as fn;
|
|
1
2
|
|
|
2
|
-
@
|
|
3
|
+
@mixin focus-ring {
|
|
4
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
5
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
6
|
+
box-shadow: var(
|
|
7
|
+
--focus-ring-box-shadow,
|
|
8
|
+
0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5))
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@mixin focusable($prefixes...) {
|
|
13
|
+
&:focus-visible {
|
|
14
|
+
@include focus-ring();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
3
17
|
|
|
4
18
|
@mixin clickable($prefixes...) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
cursor: fn.var-with-fallbacks(--disabled-cursor, append($prefixes, not-allowed)...);
|
|
18
|
-
transform: fn.var-with-fallbacks(--disabled-transform, append($prefixes, none)...);
|
|
19
|
-
filter: fn.var-with-fallbacks(--disabled-filter, append($prefixes, grayscale(0.5))...);
|
|
20
|
-
}
|
|
19
|
+
cursor: fn.var-with-fallbacks(--cursor, append($prefixes, pointer)...);
|
|
20
|
+
transition: filter,
|
|
21
|
+
transform fn.var-with-fallbacks(--transition, append($prefixes, 300ms)...);
|
|
22
|
+
&:hover {
|
|
23
|
+
filter: fn.var-with-fallbacks(
|
|
24
|
+
--hover-filter,
|
|
25
|
+
append($prefixes, brightness(1.4))...
|
|
26
|
+
);
|
|
27
|
+
transform: fn.var-with-fallbacks(
|
|
28
|
+
--hover-transform,
|
|
29
|
+
append($prefixes, none)...
|
|
30
|
+
);
|
|
21
31
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
&:active {
|
|
33
|
+
filter: fn.var-with-fallbacks(
|
|
34
|
+
--active-filter,
|
|
35
|
+
append($prefixes, brightness(0.9))...
|
|
36
|
+
);
|
|
37
|
+
transform: fn.var-with-fallbacks(
|
|
38
|
+
--active-transform,
|
|
39
|
+
append($prefixes, none)...
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
&:disabled {
|
|
43
|
+
cursor: fn.var-with-fallbacks(
|
|
44
|
+
--disabled-cursor,
|
|
45
|
+
append($prefixes, not-allowed)...
|
|
46
|
+
);
|
|
47
|
+
transform: fn.var-with-fallbacks(
|
|
48
|
+
--disabled-transform,
|
|
49
|
+
append($prefixes, none)...
|
|
50
|
+
);
|
|
51
|
+
filter: fn.var-with-fallbacks(
|
|
52
|
+
--disabled-filter,
|
|
53
|
+
append($prefixes, grayscale(0.5))...
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@mixin custom-scrollbar($prefixes...) {
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
|
|
61
|
+
// Customizing the scrollbar
|
|
62
|
+
&::-webkit-scrollbar {
|
|
63
|
+
width: fn.var-with-fallbacks(
|
|
64
|
+
--scrollbar-width,
|
|
65
|
+
append($prefixes, var(--space-md))...
|
|
66
|
+
);
|
|
67
|
+
height: fn.var-with-fallbacks(
|
|
68
|
+
--scrollbar-height,
|
|
69
|
+
append($prefixes, var(--gap))...
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&::-webkit-scrollbar-track {
|
|
74
|
+
background: fn.var-with-fallbacks(
|
|
75
|
+
--scrollbar-track-bg,
|
|
76
|
+
append($prefixes, var(--bg))...
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&::-webkit-scrollbar-thumb {
|
|
81
|
+
background: fn.var-with-fallbacks(
|
|
82
|
+
--scrollbar-thumb-bg,
|
|
83
|
+
append($prefixes, var(--stripe-bg))...
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
border-radius: fn.var-with-fallbacks(
|
|
87
|
+
--scrollbar-thumb-radius,
|
|
88
|
+
append($prefixes, var(--border-radius))...
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
background: fn.var-with-fallbacks(
|
|
93
|
+
--scrollbar-thumb-hover-bg,
|
|
94
|
+
append($prefixes, var(--secondary-bg))...
|
|
95
|
+
);
|
|
45
96
|
}
|
|
46
|
-
|
|
47
|
-
// For Firefox
|
|
48
|
-
scrollbar-width: fn.var-with-fallbacks(--scrollbar-width, append($prefixes, thin)...);
|
|
49
|
-
scrollbar-color: fn.var-with-fallbacks(--scrollbar-thumb-bg, append($prefixes, #888)...) fn.var-with-fallbacks(--scrollbar-track-bg, append($prefixes, var(--border-color))...);
|
|
50
97
|
}
|
|
51
|
-
|
|
98
|
+
|
|
99
|
+
// For Firefox
|
|
100
|
+
scrollbar-width: fn.var-with-fallbacks(
|
|
101
|
+
--scrollbar-width,
|
|
102
|
+
append($prefixes, thin)...
|
|
103
|
+
);
|
|
104
|
+
scrollbar-color: fn.var-with-fallbacks(
|
|
105
|
+
--scrollbar-thumb-bg,
|
|
106
|
+
append($prefixes, #888)...
|
|
107
|
+
)
|
|
108
|
+
fn.var-with-fallbacks(
|
|
109
|
+
--scrollbar-track-bg,
|
|
110
|
+
append($prefixes, var(--border-color))...
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@mixin visually-hidden {
|
|
115
|
+
position: absolute;
|
|
116
|
+
width: 1px;
|
|
117
|
+
height: 1px;
|
|
118
|
+
padding: 0;
|
|
119
|
+
margin: -1px;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
clip: rect(0 0 0 0);
|
|
122
|
+
clip-path: insert(50%);
|
|
123
|
+
border: 0;
|
|
124
|
+
}
|
|
@@ -150,6 +150,26 @@ div :global(p:first-of-type::first-letter) {
|
|
|
150
150
|
color: var(--body-first-letter-fg, var(--text-first-letter-fg, var(--first-letter-fg, inherit)));
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
div :global(a) {
|
|
154
|
+
color: var(--body-link-fg, var(--text-link-fg, var(--link-fg, currentColor)));
|
|
155
|
+
background-color: var(--body-link-bg, var(--text-link-bg, var(--link-bg, transparent)));
|
|
156
|
+
text-decoration: var(--body-link-text-decoration, var(--text-link-text-decoration, underline));
|
|
157
|
+
text-decoration-thickness: var(--body-link-text-decoration-thickness, var(--text-link-text-decoration-thickness, auto));
|
|
158
|
+
text-underline-offset: var(--body-link-underline-offset, var(--text-link-underline-offset, 0.2em));
|
|
159
|
+
transition: color 120ms ease, background-color 120ms ease;
|
|
160
|
+
}
|
|
161
|
+
div :global(a):focus-visible {
|
|
162
|
+
outline: var(--focus-color, -webkit-focus-ring-color) auto 1px;
|
|
163
|
+
outline-offset: var(--focus-outline-offset, 2px);
|
|
164
|
+
box-shadow: var(--focus-ring-box-shadow, 0 0 0 3px var(--focus-shadow-color, rgba(100, 150, 250, 0.5)));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
div :global(a:hover),
|
|
168
|
+
div :global(a:focus-visible) {
|
|
169
|
+
color: var(--body-link-hover-fg, var(--text-link-hover-fg, var(--link-hover-fg, var(--link-fg, currentColor))));
|
|
170
|
+
background-color: var(--body-link-hover-bg, var(--text-link-hover-bg, var(--link-hover-bg, var(--link-bg, transparent))));
|
|
171
|
+
}
|
|
172
|
+
|
|
153
173
|
div :global(code) {
|
|
154
174
|
font-family: var(--code-font-family, var(--font-family, unset));
|
|
155
175
|
text-transform: var(--code-text-transform, var(--text-transform, unset));
|
package/dist/vars/colors.css
CHANGED
package/dist/vars/defaults.css
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
--warning-text-transform: uppercase;
|
|
40
40
|
--container-link-fg: var(--primary-bg);
|
|
41
41
|
--menu-item-bg: var(--menu-bg);
|
|
42
|
+
--focus-color: var(--material-color-blue-a400);
|
|
42
43
|
}
|
|
43
44
|
body {
|
|
44
45
|
background-color: var(--bg);
|
|
@@ -442,7 +443,6 @@ body {
|
|
|
442
443
|
}
|
|
443
444
|
:root {
|
|
444
445
|
--sidebar-width: 256px;
|
|
445
|
-
--sidebar-border: 1px solid var(--fg);
|
|
446
446
|
}
|
|
447
447
|
:root {
|
|
448
448
|
font-family: var(--font-family);
|
package/dist/vars/layout.css
CHANGED
|
@@ -3,79 +3,115 @@
|
|
|
3
3
|
/* light mode */
|
|
4
4
|
|
|
5
5
|
:root {
|
|
6
|
-
--fg: var(--material-color-grey-800);
|
|
6
|
+
--fg: var(--material-color-blue-grey-800);
|
|
7
7
|
--bg: #fafafa;
|
|
8
|
-
--container-bg: var(--material-color-grey-
|
|
9
|
-
--container-fg: var(--material-color-grey-800);
|
|
10
|
-
--sidebar-bg: var(--material-color-grey-
|
|
11
|
-
--sidebar-fg: var(--material-color-grey-900);
|
|
12
|
-
--menu-bg: var(--material-color-grey-
|
|
13
|
-
--menu-fg: var(--material-color-grey-900);
|
|
14
|
-
--primary-bg: var(--material-color-blue-
|
|
15
|
-
--primary-fg: var(--material-color-grey-
|
|
16
|
-
--secondary-bg: var(--material-color-grey-
|
|
17
|
-
--secondary-fg: var(--material-color-grey-900);
|
|
18
|
-
--stripe-bg: var(--material-color-grey-900);
|
|
19
|
-
--stripe-fg: var(--material-color-grey-
|
|
20
|
-
--
|
|
21
|
-
--control-fg: var(--material-color-grey-900);
|
|
22
|
-
--border-color: var(--material-color-grey-400);
|
|
8
|
+
--container-bg: var(--material-color-blue-blue-grey-50);
|
|
9
|
+
--container-fg: var(--material-color-blue-grey-800);
|
|
10
|
+
--sidebar-bg: var(--material-color-blue-grey-50);
|
|
11
|
+
--sidebar-fg: var(--material-color-blue-grey-900);
|
|
12
|
+
--menu-bg: var(--material-color-blue-grey-50);
|
|
13
|
+
--menu-fg: var(--material-color-blue-grey-900);
|
|
14
|
+
--primary-bg: var(--material-color-blue-700);
|
|
15
|
+
--primary-fg: var(--material-color-blue-grey-50);
|
|
16
|
+
--secondary-bg: var(--material-color-blue-grey-100);
|
|
17
|
+
--secondary-fg: var(--material-color-blue-grey-900);
|
|
18
|
+
--stripe-bg: var(--material-color-blue-grey-900);
|
|
19
|
+
--stripe-fg: var(--material-color-blue-grey-50);
|
|
20
|
+
--border-color: var(--material-color-blue-grey-100);
|
|
23
21
|
--input-bg: #fefefe;
|
|
24
|
-
--input-fg: var(--material-color-grey-900);
|
|
22
|
+
--input-fg: var(--material-color-blue-grey-900);
|
|
25
23
|
--hover-filter: brightness(0.9) contrast(1.5);
|
|
26
24
|
/* Code */
|
|
27
|
-
--code-bg:
|
|
28
|
-
--code-fg:
|
|
25
|
+
--code-bg: var(--material-color-blue-grey-50); /* Softer background */
|
|
26
|
+
--code-fg: var(--material-color-blue-grey-900); /* Dark green text */
|
|
29
27
|
|
|
30
|
-
--code-comment-fg:
|
|
28
|
+
--code-comment-fg: var(--material-color-green-800); /* Softer grey */
|
|
31
29
|
--code-comment-bg: transparent;
|
|
32
30
|
|
|
33
|
-
--code-string-fg:
|
|
31
|
+
--code-string-fg: var(--material-color-orange-800);
|
|
34
32
|
--code-string-bg: transparent;
|
|
35
33
|
|
|
36
|
-
--code-keyword-fg:
|
|
34
|
+
--code-keyword-fg: var(--material-color-indigo-700);
|
|
37
35
|
--code-keyword-bg: transparent;
|
|
38
36
|
|
|
39
|
-
--code-attr-name-fg:
|
|
37
|
+
--code-attr-name-fg: var(--material-color-blue-500);
|
|
40
38
|
--code-attr-name-bg: transparent;
|
|
41
39
|
|
|
42
|
-
--code-tag-fg:
|
|
40
|
+
--code-tag-fg: var(--material-color-light-green-800);
|
|
43
41
|
--code-tag-bg: transparent;
|
|
44
42
|
|
|
45
|
-
--code-function-fg:
|
|
43
|
+
--code-function-fg: var(--material-color-blue-700);
|
|
46
44
|
--code-function-bg: transparent;
|
|
47
45
|
|
|
48
|
-
--code-variable-fg:
|
|
46
|
+
--code-variable-fg: var(--material-color-amber-600);
|
|
49
47
|
--code-variable-bg: transparent;
|
|
50
48
|
|
|
51
|
-
--code-operator-fg:
|
|
49
|
+
--code-operator-fg: var(--material-color-brown-600);
|
|
52
50
|
--code-operator-bg: transparent;
|
|
53
51
|
|
|
54
|
-
--code-prolog-fg:
|
|
52
|
+
--code-prolog-fg: var(--material-color-grey-600);
|
|
55
53
|
--code-prolog-bg: transparent;
|
|
56
54
|
|
|
57
|
-
--code-doctype-fg:
|
|
55
|
+
--code-doctype-fg: var(--material-color-grey-600);
|
|
58
56
|
--code-doctype-bg: transparent;
|
|
59
57
|
|
|
60
|
-
--code-cdata-fg:
|
|
58
|
+
--code-cdata-fg: var(--material-color-grey-600);
|
|
61
59
|
--code-cdata-bg: transparent;
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
/* dark mode */
|
|
65
63
|
@media (prefers-color-scheme: dark) {
|
|
66
64
|
:root {
|
|
67
|
-
--fg: var(--material-color-grey-
|
|
68
|
-
--bg: var(--material-color-grey-800);
|
|
69
|
-
--body-bg: var(--material-color-grey-800);
|
|
70
|
-
--body-fg: var(--material-color-grey-
|
|
71
|
-
--container-bg: var(--material-color-grey-900);
|
|
72
|
-
--container-fg: var(--material-color-grey-
|
|
73
|
-
--primary-bg: var(--material-color-light-blue-
|
|
74
|
-
--primary-fg: var(--material-color-grey-
|
|
65
|
+
--fg: var(--material-color-blue-grey-50);
|
|
66
|
+
--bg: var(--material-color-blue-grey-800);
|
|
67
|
+
--body-bg: var(--material-color-blue-grey-800);
|
|
68
|
+
--body-fg: var(--material-color-blue-grey-50);
|
|
69
|
+
--container-bg: var(--material-color-blue-grey-900);
|
|
70
|
+
--container-fg: var(--material-color-blue-grey-50);
|
|
71
|
+
--primary-bg: var(--material-color-light-blue-100);
|
|
72
|
+
--primary-fg: var(--material-color-blue-grey-800);
|
|
75
73
|
--warning-fg: var(--material-color-white);
|
|
76
74
|
--warning-bg: var(--material-color-red-800);
|
|
77
|
-
--secondary-bg: var(--material-color-grey-300);
|
|
78
|
-
--secondary-fg: var(--material-color-grey-
|
|
75
|
+
--secondary-bg: var(--material-color-blue-grey-300);
|
|
76
|
+
--secondary-fg: var(--material-color-blue-grey-800);
|
|
77
|
+
--button-bg: var(--material-color-blue-grey-800);
|
|
78
|
+
--button-fg: var(--material-color-blue-grey-50);
|
|
79
79
|
--hover-filter: brightness(1.1) contrast(1.5);
|
|
80
|
+
/* Code Block */
|
|
81
|
+
--code-bg: var(--material-color-blue-grey-800); /* Darker background */
|
|
82
|
+
--code-fg: var(--material-color-blue-grey-100); /* Lighter text */
|
|
83
|
+
|
|
84
|
+
--code-comment-fg: var(--material-color-green-300); /* Lighter green */
|
|
85
|
+
--code-comment-bg: transparent;
|
|
86
|
+
|
|
87
|
+
--code-string-fg: var(--material-color-orange-300);
|
|
88
|
+
--code-string-bg: transparent;
|
|
89
|
+
|
|
90
|
+
--code-keyword-fg: var(--material-color-indigo-300);
|
|
91
|
+
--code-keyword-bg: transparent;
|
|
92
|
+
|
|
93
|
+
--code-attr-name-fg: var(--material-color-blue-300);
|
|
94
|
+
--code-attr-name-bg: transparent;
|
|
95
|
+
|
|
96
|
+
--code-tag-fg: var(--material-color-light-green-300);
|
|
97
|
+
--code-tag-bg: transparent;
|
|
98
|
+
|
|
99
|
+
--code-function-fg: var(--material-color-blue-300);
|
|
100
|
+
--code-function-bg: transparent;
|
|
101
|
+
|
|
102
|
+
--code-variable-fg: var(--material-color-amber-300);
|
|
103
|
+
--code-variable-bg: transparent;
|
|
104
|
+
|
|
105
|
+
--code-operator-fg: var(--material-color-brown-300);
|
|
106
|
+
--code-operator-bg: transparent;
|
|
107
|
+
|
|
108
|
+
--code-prolog-fg: var(--material-color-grey-400);
|
|
109
|
+
--code-prolog-bg: transparent;
|
|
110
|
+
|
|
111
|
+
--code-doctype-fg: var(--material-color-grey-400);
|
|
112
|
+
--code-doctype-bg: transparent;
|
|
113
|
+
|
|
114
|
+
--code-cdata-fg: var(--material-color-grey-400);
|
|
115
|
+
--code-cdata-bg: transparent;
|
|
80
116
|
}
|
|
81
117
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--secondary-fg: var(--material-color-purple-800);
|
|
10
10
|
--shadow-color: #7773;
|
|
11
11
|
--border-color: var(--material-color-purple-200);
|
|
12
|
-
--
|
|
12
|
+
--focus-color: var(--material-color-purple-300);
|
|
13
13
|
/* Code */
|
|
14
14
|
--code-bg: var(
|
|
15
15
|
--material-color-grey-900
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
2
|
+
"name": "contain-css-svelte",
|
|
3
|
+
"version": "0.0.16",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "vite dev",
|
|
6
|
+
"build-css": "postcss src/lib/vars/defaults.css -o dist/vars/defaults.css",
|
|
7
|
+
"build": "NODE_ENV=production vite build && npm run package && npm run build-css",
|
|
8
|
+
"add-nojekyll": "echo > build/.nojekyll",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
11
|
+
"deploy": "NODE_ENV=production vite build && npm run add-nojekyll && gh-pages -d build -t true",
|
|
12
|
+
"prepublishOnly": "npm run package && npm run build-css",
|
|
13
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
14
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"svelte": "./dist/index.js",
|
|
20
|
+
"css": "./dist/vars/defaults.css"
|
|
21
|
+
},
|
|
22
|
+
"./vars/*": "./dist/vars/*",
|
|
23
|
+
"./themes/*": "./dist/vars/themes/*",
|
|
24
|
+
"./controls/*": "./dist/controls/*",
|
|
25
|
+
"./layout/*": "./dist/layout/*",
|
|
26
|
+
"./dropdowns/*": "./dist/dropdowns/*",
|
|
27
|
+
"./typography/*": "./dist/typography/*",
|
|
28
|
+
"./misc/*": "./dist/misc/*"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"!dist/**/*.test.*",
|
|
33
|
+
"!dist/**/*.spec.*"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"svelte": "^4.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@sveltejs/adapter-auto": "^3.2.2",
|
|
40
|
+
"@sveltejs/kit": "^2.5.17",
|
|
41
|
+
"@sveltejs/package": "^2.3.2",
|
|
42
|
+
"gh-pages": "^6.1.1",
|
|
43
|
+
"postcss": "^8.4.41",
|
|
44
|
+
"postcss-cli": "^11.0.0",
|
|
45
|
+
"postcss-import": "^16.1.0",
|
|
46
|
+
"publint": "^0.2.8",
|
|
47
|
+
"sass": "^1.77.6",
|
|
48
|
+
"svelte": "^4.2.18",
|
|
49
|
+
"svelte-check": "^3.8.1",
|
|
50
|
+
"svelte-preprocess": "^6.0.1",
|
|
51
|
+
"tslib": "^2.6.3",
|
|
52
|
+
"typescript": "^5.4.5",
|
|
53
|
+
"vite": "5.3"
|
|
54
|
+
},
|
|
55
|
+
"svelte": "./dist/index.js",
|
|
56
|
+
"types": "./dist/index.d.ts",
|
|
57
|
+
"type": "module",
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@sveltejs/adapter-static": "^3.0.2",
|
|
60
|
+
"prismjs": "^1.29.0",
|
|
61
|
+
"svelte-prism": "^1.1.6"
|
|
62
|
+
}
|
|
63
63
|
}
|