https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42902
--- Comment #4 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 200870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200870&action=edit Bug 42902: Add dark-mode regression guards Adds automated guard rails so the dark-mode work does not regress and future contributions do not re-introduce hardcoded colours in areas that have been migrated to the Koha colour tokens. This is the capstone of the dark-mode series (bugs 42898, 42899, 42900, 42901) and should be applied once the component migrations are in place. Cypress (t/cypress/integration/Theme_spec.ts): * Confirms the correct theme is applied before the page is interactive (no flash of the wrong theme). * Round-trips Light / Dark / Auto through the switcher and a reload and checks the resolved theme on the page each time. * Reads the actual computed surface/text colours and asserts they differ between light and dark, i.e. the theme really flips. * Drives the header switcher UI and checks the active state follows. * Loads several representative pages in each mode. Stylelint (.stylelintrc.json): * A "no hardcoded hex colour" rule scoped to the migrated staff SCSS, emitted as a warning (it does not fail the build) pointing reviewers at the colour tokens. Files not yet migrated, and the files that intentionally hold the colour values, are excluded; as more areas are migrated their entries are removed and the rule starts guarding them. The OPAC is out of scope. Test plan: 1) Apply the patch (after bugs 42898, 42899, 42900, 42901). 2) Cypress: run t/cypress/integration/Theme_spec.ts against a built instance. All assertions should pass. 3) Stylelint warns on a new hex literal: echo '.foo { color: #BADA55; }' \ > koha-tmpl/intranet-tmpl/prog/css/src/_demo.scss npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/_demo.scss Expect a warning pointing at the colour tokens. Remove _demo.scss afterwards. 4) Stylelint stays quiet on an already-migrated file: npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/_root.scss Expect no hex-colour warnings. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
