Selects in the dark theme: the choice list is themed for form fields only, and no test looks at a select in either theme #655
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#655
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the maintainer's list: “Most of the select fields do not respect dark theme.” No page, browser or system is named. Read from the stylesheet, the closed control is painted dark in every select; what is left to the browser, for the fourteen selects that sit outside a form field, is the open list. Nothing tests either. This issue asks for the reproduction first, then one rule and a browser test that holds it.
What exists today
assets/css/app.css:111-126definesdarkas an explicitdata-theme="dark"on the root, elseprefers-color-scheme.src/postulo/templates/base.html:2stamps the profile's choice;src/postulo/static/js/app.js:701-708stamps it as the header switch is pressed.assets/css/app.css:383-399(compiledsrc/postulo/static/css/app.css:4745-4755) setscolor-schemeon the root in the same three states. #9 asked for this; it is done. The operating system draws the open list from it.assets/css/app.css:432-445,bg-white … dark:bg-ink-950 dark:text-ink-100, in@layer base.native-select.css:option, optgroup { bg-[Canvas] text-[CanvasText] }, scoped to.field > selectandselect.select(compiled:3022-3039). Every other select leaves it to inherit the select's text colour over whatever the browser draws.assets/css/basecoat.css:325-343setsappearance: autoon.field > select,select.select,.input-group > selectand, since #305,.input-group > select[data-service-select]; a country or a language in a group is drawn without the native chevron, as the comment there says.color: var(--color-foreground)(compiled:3104-3130, in the components layer, which outranks the base rule); the group paintsdark:bg-ink-950(assets/css/basecoat.css:394-398).tests/e2e/test_accessibility.py:661,:699), but a select's popup is the platform's and is in neither the page nor a screenshot, and no test reads a select's computed colours, an option's, orcolor-scheme.The selects, by family (paths under
src/postulo/templates/):.field<c-field>; andapplications/partials/board_filters.html:22,31,40,applications/partials/bulk_fields.html:7,14,20,applications/report.html:55,81,jobs/merge.html:171,jobs/partials/bulk_fields.html:8,14,jobs/partials/listing_bulk_fields.html:14,22,server/logs.html:44,53,server/design.html:157,196.fieldapplications/partials/application_card.html:64(the board's status),applications/suggestion_list.html:82,core/import_csv_map.html:35,58,cotton/table/filter.html:76(every table's column filter),documents/letter_detail.html:74,jobs/posting_detail.html:37,partials/table/columns.html:40(page size).input-grouppartials/phone_widget.html:38-41(country of a number),partials/postal_addresses.html:91-93(country),partials/web_links.html:48-50(the service),server/defaults.html:32-34(default language),server/design.html:180,209What cannot be established from here is which of these looks wrong on the maintainer's screen, and in which browser. The open list is drawn by the platform; the page can state only
color-schemeand the options' own colours.Checked against
mainatf09b6010b.Proposal
assets/css/app.css, ontoselect option, select optgroup, in the same tokens as the closed box (bg-white text-ink-900 dark:bg-ink-950 dark:text-ink-100), so the list is the colour of the box it opens from. Forced colours keep the system pair, as the rest of the file does.npm run build:cssand commit the compiled stylesheet.Decisions
Canvasis the browser's near-black in dark and white in light; the closed box is ink-950 and white. Recommended: tokens, so the box and its list are one colour. System colours stay for forced colours.Needed by
Issue #301 (axe clean in both themes) can take its test from here.
Done when
tests/e2e/test_dark_selects.py(new,-m e2e): for one select of each family above, in three states (profile dark, nothing stamped with the system dark, profile light with the system dark), it readsgetComputedStyleforcolor-scheme, the select, and each of its options, and asserts that the root'scolor-schemeisdarkorlightas stated, that the select's text and ground clear 4.5:1, and that every option has an opaque ground and text of its own that clear 4.5:1 and are dark in the dark states and light in the light one.tests/test_contrast.pygains the same check on the tokens the list now uses, in both themes.tests/e2e/test_accessibility.py), andtests/test_stylesheet.pypasses on the rebuilt stylesheet.From the list of improvements of 2026-10-02.