DEV: Experimenting with using built in core color palettes for the color picking component (#71)
This PR is the beginning of converting the color picker to use built in core color palettes. The `color_schemes` defined in `about.json` are created in core when the theme is imported, and we then show all user-selectable color palettes in this sidebar footer menu. An important caveat here is that all of the Horizon themes must be changed to `user_selectable` otherwise they will not show up in the color palette selector in the sidebar. When choosing a color palette that also has a corresponding dark color palette, *both* light mode and dark mode are correctly saved with the color palette(s) chosen, using the color palette cookie we already have in core. Anon users can also set a palette, which will be saved in a cookie. --------- Co-authored-by: Sérgio Saquetim <saquetim@discourse.org> Co-authored-by: Martin Brennan <martin@discourse.org> Co-authored-by: Osama Sayegh <asooomaasoooma90@gmail.com>
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
html {
|
||||
--accent-color: #{$tertiary} !important;
|
||||
--accent-text-color: light-dark(#ffffff, #212121) !important;
|
||||
// Background Colors
|
||||
--background-color: light-dark(
|
||||
oklch(from #{$tertiary} 98% calc(c * 0.25) h),
|
||||
oklch(from #{$tertiary} 10% 0.025 h)
|
||||
) !important;
|
||||
--d-content-background: light-dark(
|
||||
oklch(from #{$secondary} calc(2 * l) c h),
|
||||
oklch(from #{$secondary} l c h)
|
||||
) !important;
|
||||
// HeaderColors
|
||||
--header_primary-low-mid: light-dark(
|
||||
oklch(from #{$tertiary} 73.5% calc(c * 0.5) h),
|
||||
oklch(from #{$tertiary} l calc(c * 0.25) h)
|
||||
) !important;
|
||||
--header_primary-medium: light-dark(
|
||||
oklch(from #{$tertiary} 54% calc(c * 0.5) h),
|
||||
oklch(from #{$tertiary} calc(l * 1.35) calc(c * 0.25) h)
|
||||
) !important;
|
||||
|
||||
// Sidebar Colors
|
||||
--d-sidebar-border-color: light-dark(
|
||||
oklch(from #{$tertiary} 90% c h),
|
||||
oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h)
|
||||
) !important;
|
||||
--d-sidebar-link-color: light-dark(
|
||||
oklch(from #{$tertiary} calc(l * 0.8) calc(c * 0.25) h),
|
||||
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.25) h)
|
||||
) !important;
|
||||
--d-sidebar-suffix-color: light-dark(
|
||||
oklch(from #{$tertiary} l calc(c * 0.9) h),
|
||||
oklch(from #{$tertiary} l calc(c * 0.9) h)
|
||||
) !important;
|
||||
|
||||
// Other Colors
|
||||
--d-selected: light-dark(
|
||||
oklch(from #{$tertiary} 92% calc(c * 0.5) h),
|
||||
oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h)
|
||||
) !important;
|
||||
|
||||
--d-nav-color--active: #{$tertiary} !important;
|
||||
--link-color: light-dark(
|
||||
#{$tertiary},
|
||||
oklch(from #{$tertiary} calc(l * 0.95) c h)
|
||||
) !important;
|
||||
--link-color-hover: light-dark(
|
||||
#{$tertiary},
|
||||
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 2.25) h)
|
||||
) !important;
|
||||
--tertiary-hover: #{$tertiary} !important;
|
||||
|
||||
// Search Colors
|
||||
--search-color: light-dark(
|
||||
oklch(from #{$tertiary} calc(l * 0.65) calc(c * 0.65) h),
|
||||
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 2) h)
|
||||
) !important;
|
||||
--search-banner-text-color: light-dark(
|
||||
oklch(from #{$tertiary} calc(l * 0.65) calc(c * 0.65) h),
|
||||
oklch(from #{$tertiary} calc(l * 1.85) calc(c * 2) h)
|
||||
) !important;
|
||||
|
||||
// Topic Card Colors
|
||||
--topic-card-shadow: light-dark(
|
||||
oklch(from #{$tertiary} calc(l * 1.85) calc(c * 0.5) h),
|
||||
oklch(from #{$tertiary} calc(l * 0.2) calc(c * 0.01) h / 0.25)
|
||||
) !important;
|
||||
|
||||
// Button Colors
|
||||
--button-box-shadow: light-dark(
|
||||
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.35) h),
|
||||
oklch(from #{$tertiary} calc(l * 0.75) calc(c * 0.5) h)
|
||||
) !important;
|
||||
|
||||
--d-sidebar-highlight-hover-icon: var(--d-sidebar-link-color) !important;
|
||||
--d-sidebar-highlight-hover-background: var(--d-selected) !important;
|
||||
--d-sidebar-link-icon-color: var(--d-sidebar-link-color) !important;
|
||||
--d-sidebar-header-color: var(--d-sidebar-link-color) !important;
|
||||
--d-sidebar-header-icon-color: var(--d-sidebar-link-color) !important;
|
||||
--d-sidebar-active-suffix-color: var(--d-sidebar-suffix-color) !important;
|
||||
--d-sidebar-background: var(--background-color) !important;
|
||||
--d-sidebar-footer-fade: var(--background-color) !important;
|
||||
--d-sidebar-prefix-background: var(--d-selected) !important;
|
||||
--d-sidebar-active-prefix-background: light-dark(
|
||||
oklch(from var(--d-selected) calc(l * 0.85) c h),
|
||||
oklch(from var(--d-selected) calc(l * 0.7) c h)
|
||||
) !important;
|
||||
--d-sidebar-highlight-prefix-background: light-dark(
|
||||
oklch(from var(--d-selected) calc(l * 0.85) c h),
|
||||
oklch(from var(--d-selected) calc(l * 0.7) c h)
|
||||
) !important;
|
||||
--d-sidebar-highlight-suffix-color: var(
|
||||
--d-sidebar-active-suffix-color
|
||||
) !important;
|
||||
--d-sidebar-highlight-color: var(--primary) !important;
|
||||
--d-sidebar-highlight-background: var(--d-selected) !important;
|
||||
--d-sidebar-section-link-icon-size: 1em !important;
|
||||
--d-hover: oklch(from var(--d-selected) l c h / 0.75) !important;
|
||||
--d-input-bg-color: var(--d-content-background) !important;
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
@import "buttons";
|
||||
@import "chat";
|
||||
@import "color-choice";
|
||||
@import "color-exploration";
|
||||
@import "composer";
|
||||
@import "header";
|
||||
@import "hiddenstuff";
|
||||
|
||||
Reference in New Issue
Block a user