@webority/theme 0.34.0 → 0.35.0
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/README.md +10 -19
- package/dist/purge-safelist.json +16 -0
- package/dist/webority-theme.css +1 -1
- package/package.json +1 -1
- package/scss/_wui-components.scss +1 -0
- package/scss/wui/_avatar-picker.scss +116 -0
- package/scss/wui/_image-crop.scss +70 -1
- package/scss/wui/_kanban.scss +81 -8
package/README.md
CHANGED
|
@@ -107,28 +107,19 @@ and Bootstrap's utility classes (`.text-body`, `.bg-secondary`) and components r
|
|
|
107
107
|
the `[data-bs-theme="dark"]` selector that Bootstrap provides. **Pair the attributes**—setting
|
|
108
108
|
one without the other leaves part of the system on the wrong palette.
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
Use `AppThemeToggle` (React) or `<app-theme-toggle>` (Razor) rather than wiring the attributes
|
|
111
|
+
by hand: it offers System, Light and Dark, stores the choice in localStorage, writes both
|
|
112
|
+
attributes, and announces `wui:theme:change`. Nothing stored means System (`data-theme="auto"`),
|
|
113
|
+
so a page follows the device until someone picks a theme. Put the before-paint script in
|
|
114
|
+
`<head>` on every page, before the stylesheets, so the stored theme lands before first paint:
|
|
115
|
+
`<app-theme-script storage-key="theme" />` on Razor, the inlined output of
|
|
116
|
+
`themeBootScript("theme")` from `@webority/ui-react` on React.
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
// On mount:
|
|
114
|
-
const theme = localStorage.getItem('theme') || 'light';
|
|
115
|
-
document.documentElement.setAttribute('data-theme', theme);
|
|
116
|
-
document.documentElement.setAttribute('data-bs-theme', theme);
|
|
117
|
-
|
|
118
|
-
// On toggle:
|
|
119
|
-
const newTheme = theme === 'light' ? 'dark' : 'light';
|
|
120
|
-
document.documentElement.setAttribute('data-theme', newTheme);
|
|
121
|
-
document.documentElement.setAttribute('data-bs-theme', newTheme);
|
|
122
|
-
localStorage.setItem('theme', newTheme);
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Automatic detection (opt-in)
|
|
118
|
+
### Automatic detection
|
|
126
119
|
|
|
127
120
|
Set `data-theme="auto"` on `<html>` to detect the system preference via `@media (prefers-color-scheme: dark)`
|
|
128
|
-
and apply the dark remap automatically.
|
|
129
|
-
|
|
130
|
-
portals where the portal doesn't control color preference; omit for apps that give users a
|
|
131
|
-
theme picker.
|
|
121
|
+
and apply the dark remap automatically. The toggle's System choice is this mode; it also writes the
|
|
122
|
+
resolved theme to `data-bs-theme` and keeps it in step when the device changes.
|
|
132
123
|
|
|
133
124
|
### Implementation
|
|
134
125
|
|
package/dist/purge-safelist.json
CHANGED
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"btn-outline-secondary",
|
|
123
123
|
"btn-primary",
|
|
124
124
|
"btn-secondary",
|
|
125
|
+
"btn-secondary-danger",
|
|
125
126
|
"btn-sm",
|
|
126
127
|
"btn-static",
|
|
127
128
|
"btn-subtle",
|
|
@@ -714,6 +715,13 @@
|
|
|
714
715
|
"workspace-switcher-tick",
|
|
715
716
|
"workspace-switcher-trigger",
|
|
716
717
|
"workspace-switcher-trigger-name",
|
|
718
|
+
"wui-avatar-picker",
|
|
719
|
+
"wui-avatar-picker-actions",
|
|
720
|
+
"wui-avatar-picker-badge",
|
|
721
|
+
"wui-avatar-picker-camera",
|
|
722
|
+
"wui-avatar-picker-face",
|
|
723
|
+
"wui-avatar-picker-img",
|
|
724
|
+
"wui-avatar-picker-placeholder",
|
|
717
725
|
"wui-banner",
|
|
718
726
|
"wui-banner-body",
|
|
719
727
|
"wui-banner-dismiss",
|
|
@@ -827,7 +835,12 @@
|
|
|
827
835
|
"wui-crop-frame--round",
|
|
828
836
|
"wui-crop-handle",
|
|
829
837
|
"wui-crop-img",
|
|
838
|
+
"wui-crop-preview",
|
|
839
|
+
"wui-crop-previews",
|
|
840
|
+
"wui-crop-previews--round",
|
|
830
841
|
"wui-crop-stage",
|
|
842
|
+
"wui-crop-toolbtn",
|
|
843
|
+
"wui-crop-tools",
|
|
831
844
|
"wui-crop-zoom",
|
|
832
845
|
"wui-crop-zoombtn",
|
|
833
846
|
"wui-dashboard-cell",
|
|
@@ -899,6 +912,8 @@
|
|
|
899
912
|
"wui-icon",
|
|
900
913
|
"wui-icon-tip",
|
|
901
914
|
"wui-kanban",
|
|
915
|
+
"wui-kanban-action",
|
|
916
|
+
"wui-kanban-actions",
|
|
902
917
|
"wui-kanban-board",
|
|
903
918
|
"wui-kanban-body",
|
|
904
919
|
"wui-kanban-card",
|
|
@@ -911,6 +926,7 @@
|
|
|
911
926
|
"wui-kanban-ghost",
|
|
912
927
|
"wui-kanban-head",
|
|
913
928
|
"wui-kanban-hint",
|
|
929
|
+
"wui-kanban-lock",
|
|
914
930
|
"wui-kanban-more",
|
|
915
931
|
"wui-kanban-summary",
|
|
916
932
|
"wui-kanban-switch",
|