Tokenise the remaining backend colours so dark mode can be a pure variable redefinition
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- css
- Ambito
- frontend
Direzione di ricerca
Start with modules/backend/assets/less/layout/fancylayout.less and modules/backend/models/brandsetting/custom.less, then inspect the listed variable files and IconPicker.vue. Run the dark-tokens harness from wn-tailwindui-plugin to verify each core token replacement and confirm the matching darkmode.css and fancy-layout.css overrides can be deleted without changing light mode.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
#1541 routed core's colour literals through --wn-* tokens so that dark mode (and other themes) can redefine a variable instead of overriding every rule that paints something. The TailwindUI dark mode now does that (wintercms/wn-tailwindui-plugin#58): a .dark { --wn-…: … } block replaced 86 per-element declarations.
But some backend colours never became variables, and every dark-mode fix since has had to fall back to per-selector overrides, 31 of them with !important. Each gap below needs a core change so the corresponding plugin override can be deleted and dark mode becomes a pure variable redefinition.
Gaps
- Brand-derived fancy chrome. The fancy header band, tab bars, active/inactive tabs, their wings, and the breadcrumb bar, segments, arrow tips and separators are all LESS
mix()/saturate()expressions on@brand-secondary. They're compiled at build time inmodules/backend/assets/less/layout/fancylayout.less, and again at runtime inmodules/backend/models/brandsetting/custom.less(lines ~133–240). Novar()is involved, so dark mode has to override every selector with!importantto beat the runtime brand CSS.- Fix: have
custom.lessemit these as custom properties computed from the brand settings (e.g.--wn-fancy-header-bg,--wn-fancy-tab-bar,--wn-fancy-tab-active,--wn-fancy-tab-inactive,--wn-breadcrumb-bar,--wn-breadcrumb-segment,--wn-breadcrumb-current). Point the fancy-layout and breadcrumb rules at them. This is step 2b ofbrand-color-variable-architecture.md(on the plugin'swip/darkmode-auditbranch). - Retires: the tab, wing, breadcrumb and header-band overrides in the plugin's
darkmode.cssandcomponents/fancy-layout.css.
- Fix: have
- Named-colour literals the hex sweep missed.
fancylayout.lessuseswhitefor the secondary-content tab wings and titles (lines ~419, 450, 473, 477, 841). The tokenisation only matched hex values, so these stayed literal and draw white edges and lines in dark mode.- Fix: sweep core LESS for named colours (
white,black,silver, …) and tokenise them like the hex literals.
- Fix: sweep core LESS for named colours (
- Input-group addon.
@input-group-addon-bg: @gray-lighter(form.variables.less:26) is a compile-time literal, so the email/URL field icons stay a light box.- Fix: a surface token, if nothing derives from it at compile time.
- Active and hover rows reuse a text token.
@color-list-activeand@color-list-hoverarevar(--wn-text-faint, #ddd)(list.variables.less:15-16). They paint the tree, file list and asset list active/hover row backgrounds (treeview.less,filelist.less,assetlist.less). Redefining--wn-text-faintfor dark text turns those rows into grey blocks.- Fix: give them their own role tokens (e.g.
--wn-surface-row-active,--wn-surface-row-hover).
- Fix: give them their own role tokens (e.g.
- Date and time picker states.
@color-datepicker-today-text: @brand-primaryand@color-datepicker-selected-bg: @brand-accent(datepicker.variables.less:5-6) are compile-time brand colours. So is the clockpicker header's.text-primary. The clockpicker dial colours (.clockpicker-canvas-bg,-fg, the hand) are literals indatepicker.time.less:271+. In dark mode, today is navy on a dark cell, the selected date is white on green (~2:1), and the selected hour is a pale bubble behind light numerals.- Fix: tokens for the selected, today, dial and hand colours.
- Switch knob.
.slide-button(checkbox.less:246) is painted with--wn-surface-hover. The knob should stay light in both modes while hover surfaces go dark, so dark mode currently has to pin the knob back.- Fix: give the knob its own token.
- Icon picker modal.
modules/backend/formwidgets/iconpicker/assets/js/src/components/IconPicker.vuehard-codes its panel, tile, search and footer colours in scoped CSS. Scoped CSS is injected after the skin's stylesheet with equal specificity, so dark mode has to anchor its overrides on.aim-modal.aim-opento win.- Fix: point the component's colours at the existing surface, text and border tokens.
- Logos on dark surfaces.
.wn-logo/.oc-logoand the empty-editor watermark (*-logo-transparent) hard-codeurl(../images/logo-dark.svg)incontrols/common.less. Dark mode swaps inlogo-light.svgwith a root-absolute URL, which breaks on subdirectory installs.- Fix: a custom property for the logo image (e.g.
--wn-logo-image), so a theme can switch it without knowing the install path.
- Fix: a custom property for the logo image (e.g.
Done when
Each gap is a variable in core, and the matching overrides in wn-tailwindui-plugin's darkmode.css / fancy-layout.css are deleted. That deletion should be verified with the dark-tokens harness, which proves a removal changes nothing and that light mode is untouched.
- Lingua principale
- PHP
- Stelle
- 1.5k
- Fork
- 251
- Merge medio
- 2g 16h
- PR unite (30g)
- 10
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wintercms/winter
-
create:theme --tailwind scaffolds version.yaml at 1.0.0 while the LESS variant scaffolds 1.0.1Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
needs review
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
wintercms/winter#1539 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Snowboard's Url utility mangles protocol-relative asset URLs, hanging AJAX handlersForse già presa @wakqasahmed l’ha presa 25 giorni fa. Apertalow priority needs pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
wintercms/winter#1538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
vite:watch writes an unreachable dev-server URL (http://[::]:5173) to the hot file on IPv6 hostsForse già presa @LukeTowers l’ha presa 60 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
wintercms/winter#1537 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wintercms/winter
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
MagnaCapax/PMSS#1142 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Native-arrow select renders a second Jetpack chevronForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Automattic/static-site-importer#2294 ·
I maintainer di solito rispondono entro 1 giorno
-
bug 🐛
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
netalertx/NetAlertX#1856 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100