Compile hook-inverse colours as CSS variables now components don't import the full less theme

This commit is contained in:
Julian Stirling 2026-06-24 17:36:24 +01:00
parent 21d0beedb9
commit 7aab8b742a
4 changed files with 24 additions and 23 deletions

View file

@ -160,6 +160,27 @@
@sidebar-right-left: 0px; @sidebar-right-left: 0px;
@sidebar-right-left-xl: 60px; @sidebar-right-left-xl: 60px;
/**
* Self inverting colours
*
* These invert automatically when the theme inverts. these need to be used as css variables.
* They can be used without importing uikit/src/less/uikit.theme.less fully into the
* component.
*/
:root {
--theme-text-colour: @global-color;
.hook-inverse() {
--theme-text-colour: @inverse-global-color;
}
--theme-primary-background: @global-primary-background;
.hook-inverse() {
--theme-primary-background: @inverse-primary-muted-color;
}
}
/* /*
* Navbar * Navbar
*/ */

View file

@ -63,14 +63,7 @@ export default {
.progress .indeterminate, .progress .indeterminate,
.progress .determinate { .progress .determinate {
background-color: @global-primary-background; background-color: var(--theme-primary-background);
}
.hook-inverse() {
.progress .indeterminate,
.progress .determinate {
background-color: @inverse-primary-muted-color;
}
} }
.progress .indeterminate::before { .progress .indeterminate::before {

View file

@ -81,14 +81,7 @@ export default {
.progress .indeterminate, .progress .indeterminate,
.progress .determinate { .progress .determinate {
background-color: @global-primary-background; background-color: var(--theme-primary-background);
}
.hook-inverse() {
.progress .indeterminate,
.progress .determinate {
background-color: @inverse-primary-muted-color;
}
} }
.progress .indeterminate::before { .progress .indeterminate::before {

View file

@ -147,13 +147,7 @@ export default {
} }
.copy-button:hover { .copy-button:hover {
color: @global-color; color: var(--themed-global-colour);
}
.hook-inverse() {
.copy-button:hover {
color: @inverse-global-color;
}
} }
.copy-button.success { .copy-button.success {