@starlove/orbit 1.3.2 → 1.3.4
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/SKILL-ORBIT.md +4 -0
- package/dist/full/index.html +2 -2
- package/dist/full/js/{app.b8296a78.js → app.fb7767dc.js} +90 -90
- package/dist/full/js/app.fb7767dc.js.map +7 -0
- package/dist/full/orbits-logo-bg-wide.png +0 -0
- package/dist/full/{styles.65b79f8a.css → styles.bbc542f5.css} +1 -1
- package/dist/full/version.json +2 -2
- package/package.json +1 -1
- package/public/js/starscape.js +10 -0
- package/public/js/theme-preference.js +13 -6
- package/public/orbits-logo-bg-wide.png +0 -0
- package/public/styles.css +11 -11
- package/dist/full/js/app.b8296a78.js.map +0 -7
package/dist/full/version.json
CHANGED
package/package.json
CHANGED
package/public/js/starscape.js
CHANGED
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
THEME_CHANGE_EVENT,
|
|
15
15
|
applyStoredThemePreference,
|
|
16
16
|
currentTheme,
|
|
17
|
+
storedThemePreference,
|
|
18
|
+
setThemePreference,
|
|
17
19
|
toggleThemePreference
|
|
18
20
|
} from "./theme-preference.js";
|
|
19
21
|
|
|
@@ -42,6 +44,14 @@ themeToggle?.addEventListener("click", () => {
|
|
|
42
44
|
toggleThemePreference();
|
|
43
45
|
});
|
|
44
46
|
|
|
47
|
+
// When there's no explicit user preference stored, track OS changes live so
|
|
48
|
+
// data-theme stays in sync and CSS selectors ([data-theme="dark"]) keep working.
|
|
49
|
+
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
|
|
50
|
+
if (!storedThemePreference()) {
|
|
51
|
+
setThemePreference(e.matches ? "dark" : "light", { notify: true });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
45
55
|
window.addEventListener(THEME_CHANGE_EVENT, () => {
|
|
46
56
|
syncThemeIcon();
|
|
47
57
|
starscape.sync();
|
|
@@ -37,20 +37,27 @@ export function storedThemePreference(storage = safeStorage()) {
|
|
|
37
37
|
return THEMES.has(value) ? value : null;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function systemTheme() {
|
|
41
|
+
try {
|
|
42
|
+
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
43
|
+
} catch {
|
|
44
|
+
return "light";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
export function currentTheme({ doc = safeDocument(), storage = safeStorage() } = {}) {
|
|
41
49
|
const rootTheme = safeDocument(doc)?.documentElement?.getAttribute?.("data-theme");
|
|
42
|
-
|
|
50
|
+
if (THEMES.has(rootTheme)) return rootTheme;
|
|
51
|
+
return storedThemePreference(storage) ?? systemTheme();
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
export function applyStoredThemePreference({
|
|
46
55
|
doc = safeDocument(),
|
|
47
56
|
storage = safeStorage()
|
|
48
57
|
} = {}) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return currentTheme({ doc, storage });
|
|
58
|
+
const theme = storedThemePreference(storage) ?? systemTheme();
|
|
59
|
+
safeDocument(doc)?.documentElement?.setAttribute?.("data-theme", theme);
|
|
60
|
+
return theme;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
export function setThemePreference(theme, {
|
|
Binary file
|
package/public/styles.css
CHANGED
|
@@ -1761,7 +1761,7 @@ button.add-card-phantom::after,
|
|
|
1761
1761
|
position: relative;
|
|
1762
1762
|
}
|
|
1763
1763
|
|
|
1764
|
-
.card-action-button {
|
|
1764
|
+
button.card-action-button {
|
|
1765
1765
|
width: 100%;
|
|
1766
1766
|
min-width: 11.5rem;
|
|
1767
1767
|
display: grid;
|
|
@@ -1779,18 +1779,18 @@ button.add-card-phantom::after,
|
|
|
1779
1779
|
cursor: url('cursors/live_link.cur'), pointer;
|
|
1780
1780
|
}
|
|
1781
1781
|
|
|
1782
|
-
.card-action-menu-item.has-submenu > .card-action-button {
|
|
1782
|
+
.card-action-menu-item.has-submenu > button.card-action-button {
|
|
1783
1783
|
grid-template-columns: 1fr auto;
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
.card-action-button:hover,
|
|
1787
|
-
.card-action-button:focus-visible,
|
|
1788
|
-
.card-action-menu-item.is-open > .card-action-button {
|
|
1786
|
+
button.card-action-button:hover,
|
|
1787
|
+
button.card-action-button:focus-visible,
|
|
1788
|
+
.card-action-menu-item.is-open > button.card-action-button {
|
|
1789
1789
|
outline: none;
|
|
1790
1790
|
background: rgba(var(--accent-rgb), 0.12);
|
|
1791
1791
|
}
|
|
1792
1792
|
|
|
1793
|
-
.card-action-button:disabled {
|
|
1793
|
+
button.card-action-button:disabled {
|
|
1794
1794
|
cursor: default;
|
|
1795
1795
|
color: var(--orbit-text-muted);
|
|
1796
1796
|
opacity: 0.82;
|
|
@@ -1808,12 +1808,12 @@ button.add-card-phantom::after,
|
|
|
1808
1808
|
white-space: nowrap;
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
|
-
.card-action-menu-item.is-danger > .card-action-button {
|
|
1811
|
+
.card-action-menu-item.is-danger > button.card-action-button {
|
|
1812
1812
|
color: #b42318;
|
|
1813
1813
|
}
|
|
1814
1814
|
|
|
1815
|
-
.card-action-menu-item.is-danger > .card-action-button:hover,
|
|
1816
|
-
.card-action-menu-item.is-danger > .card-action-button:focus-visible {
|
|
1815
|
+
.card-action-menu-item.is-danger > button.card-action-button:hover,
|
|
1816
|
+
.card-action-menu-item.is-danger > button.card-action-button:focus-visible {
|
|
1817
1817
|
background: rgba(var(--red-rgb), 0.12);
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
@@ -1839,13 +1839,13 @@ button.add-card-phantom::after,
|
|
|
1839
1839
|
|
|
1840
1840
|
[data-theme="dark"] .card-action-menu,
|
|
1841
1841
|
[data-theme="dark"] .card-action-submenu {
|
|
1842
|
-
color: var(--
|
|
1842
|
+
color: var(--orbit-text);
|
|
1843
1843
|
background: rgba(var(--cosmos-rgb), 0.96);
|
|
1844
1844
|
border-color: rgba(var(--starlight-rgb), 0.16);
|
|
1845
1845
|
box-shadow: 0 18px 48px rgba(var(--void-rgb), 0.55), 0 0 0 1px rgba(var(--starlight-rgb), 0.04);
|
|
1846
1846
|
}
|
|
1847
1847
|
|
|
1848
|
-
[data-theme="dark"] .card-action-menu-item.is-danger > .card-action-button {
|
|
1848
|
+
[data-theme="dark"] .card-action-menu-item.is-danger > button.card-action-button {
|
|
1849
1849
|
color: #fca5a5;
|
|
1850
1850
|
}
|
|
1851
1851
|
|