fix: fix bug with theme setting
This commit is contained in:
parent
616e9ca06e
commit
d8fac409d7
14
src/app.css
14
src/app.css
|
@ -74,29 +74,33 @@ main > div > div:first-child {
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply-form > label {
|
.apply-form > label {
|
||||||
color: white;
|
color: var(--green);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply-form > p {
|
.apply-form > p {
|
||||||
color: white;
|
color: var(--green);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply-input {
|
.apply-input {
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 1px solid white;
|
border: 1px solid var(--green);
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply-submit {
|
.apply-submit {
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: white;
|
color: var(--green);
|
||||||
border: 1px solid white;
|
border: 1px solid var(--green);
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-list {
|
||||||
|
white-space: pre-wrap !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.apply-form {
|
.apply-form {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -13,6 +13,15 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
input.focus();
|
input.focus();
|
||||||
|
|
||||||
|
console.log("dsadas", $theme);
|
||||||
|
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
"--text-color",
|
||||||
|
`${$theme.foreground}`
|
||||||
|
);
|
||||||
|
|
||||||
|
document.documentElement.style.setProperty("--green", `${$theme.green}`);
|
||||||
|
|
||||||
if ($history.length === 0) {
|
if ($history.length === 0) {
|
||||||
const command = commands["banner"] as () => string;
|
const command = commands["banner"] as () => string;
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ export const commands: Record<
|
||||||
let result = themes.map((t) => t.name.toLowerCase()).join(", ");
|
let result = themes.map((t) => t.name.toLowerCase()).join(", ");
|
||||||
result += `You can preview all these themes here: ${packageJson.repository.url}/tree/master/docs/themes`;
|
result += `You can preview all these themes here: ${packageJson.repository.url}/tree/master/docs/themes`;
|
||||||
|
|
||||||
return result;
|
return `<template><span class="theme-list">${result}</span></template>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
case "set": {
|
case "set": {
|
||||||
|
@ -91,6 +91,13 @@ export const commands: Record<
|
||||||
return `Theme '${selectedTheme}' not found. Try 'theme ls' to see all available themes.`;
|
return `Theme '${selectedTheme}' not found. Try 'theme ls' to see all available themes.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
"--text-color",
|
||||||
|
`${t.foreground}`
|
||||||
|
);
|
||||||
|
|
||||||
|
document.documentElement.style.setProperty("--green", `${t.green}`);
|
||||||
|
|
||||||
theme.set(t);
|
theme.set(t);
|
||||||
|
|
||||||
return `Theme set to ${selectedTheme}`;
|
return `Theme set to ${selectedTheme}`;
|
||||||
|
|
Loading…
Reference in New Issue