big theme refactoring has begun

This commit is contained in:
2023-12-15 21:00:39 +01:00
parent 94c1574d96
commit 278ab026cd
4 changed files with 56 additions and 83 deletions

View File

@ -2278,8 +2278,9 @@ export class UserAPI {
console.log("Changing color scheme for: ", color_scheme)
}
public randomTheme = (): string => {
public randomTheme = (): void => {
let theme_names = Object.keys(colorschemes);
return theme_names[Math.floor(Math.random() * theme_names.length)];
let selected_theme = theme_names[Math.floor(Math.random() * theme_names.length)];
this.app.readTheme(selected_theme);
}
}

View File

@ -211,7 +211,7 @@ export class Editor {
loadUniverserFromUrl(this);
// Set the color scheme for the application
this.readTheme(app.settings.theme);
this.readTheme(this.settings.theme);
}
private getBuffer(type: string): any {

View File

@ -1146,38 +1146,30 @@ video {
background-color: rgb(var(--background) / var(--tw-bg-opacity));
}
.bg-foreground {
--tw-bg-opacity: 1;
background-color: rgb(var(--foreground) / var(--tw-bg-opacity));
}
.bg-selection_foreground {
--tw-bg-opacity: 1;
background-color: rgb(var(--selection_foreground) / var(--tw-bg-opacity));
}
.bg-black {
--tw-bg-opacity: 1;
background-color: rgb(var(--black) / var(--tw-bg-opacity));
}
.bg-foreground {
--tw-bg-opacity: 1;
background-color: rgb(var(--foreground) / var(--tw-bg-opacity));
}
.bg-selection_background {
--tw-bg-opacity: 1;
background-color: rgb(var(--selection_background) / var(--tw-bg-opacity));
}
.fill-background {
fill: rgb(var(--background) / 1);
.bg-selection_foreground {
--tw-bg-opacity: 1;
background-color: rgb(var(--selection_foreground) / var(--tw-bg-opacity));
}
.p-1 {
padding: 0.25rem;
}
.p-1\.5 {
padding: 0.375rem;
}
.p-2 {
padding: 0.5rem;
}
@ -1389,16 +1381,16 @@ video {
line-height: 1.5;
}
.text-background {
--tw-text-opacity: 1;
color: rgb(var(--background) / var(--tw-text-opacity));
}
.text-black {
--tw-text-opacity: 1;
color: rgb(var(--black) / var(--tw-text-opacity));
}
.text-brightwhite {
--tw-text-opacity: 1;
color: rgb(var(--brightwhite) / var(--tw-text-opacity));
}
.text-red {
--tw-text-opacity: 1;
color: rgb(var(--red) / var(--tw-text-opacity));
@ -1426,16 +1418,6 @@ video {
text-underline-offset: 4px;
}
.placeholder-background::-moz-placeholder {
--tw-placeholder-opacity: 1;
color: rgb(var(--background) / var(--tw-placeholder-opacity));
}
.placeholder-background::placeholder {
--tw-placeholder-opacity: 1;
color: rgb(var(--background) / var(--tw-placeholder-opacity));
}
.opacity-50 {
opacity: 0.5;
}
@ -1465,36 +1447,11 @@ video {
transition-duration: 150ms;
}
.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.duration-200 {
transition-duration: 200ms;
}
.hover\:bg-background:hover {
--tw-bg-opacity: 1;
background-color: rgb(var(--background) / var(--tw-bg-opacity));
}
.hover\:bg-selection_foreground:hover {
--tw-bg-opacity: 1;
background-color: rgb(var(--selection_foreground) / var(--tw-bg-opacity));
}
.hover\:bg-white:hover {
--tw-bg-opacity: 1;
background-color: rgb(var(--white) / var(--tw-bg-opacity));
}
.hover\:bg-brightwhite:hover {
--tw-bg-opacity: 1;
background-color: rgb(var(--brightwhite) / var(--tw-bg-opacity));
}
.hover\:fill-black:hover {
fill: rgb(var(--black) / 1);
}