Component markup copies rule names as hand-written class strings
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 2. The View refers to rules (Style.ruleName, an element named like its rule, #name), no hand-written class strings that copy a rule.
Nearly every component writes class strings that exist only to hit a rule in components/styles.hl. Examples: components/ticket_list.hl lines 78, 89, 91, 93, 100, 128-130, 134 (primary, empty, connections, connection, button, notice, tickets, subject) and the dynamic classes row.stateSlug and f.cls; components/inbox.hl lines 27-28, 32, 43-44, 48 (empty, tickets, subject, row.stateSlug); components/ticket.hl lines 121, 129, 133 (empty, people, dates) plus refsubject, refs, was, unblock, c.stateSlug, parentRef.stateSlug and en.ev.toSlug; components/you.hl lines 34, 48, 50, 74, 78 (empty, role, label, revoke); components/settings.hl lines 47, 77, 78 (empty, membername, memberrole); components/connect.hl lines 36, 70, 71 (empty, notice, button); components/new_project.hl line 22 (notice). Other rules are hit through ids (#parentform, #blockerform, #childnote, #events, #members in styles.hl).
The framework way: the rule lives in the component's own Style block and the View uses an element named like the rule or Style.ruleName, so the name is checked by the build and cannot drift from the stylesheet. This belongs together with tickets#36 (moving the styles) but is a separate step: after the move the markup still has to stop spelling the class names.
History
Atlas opened the ticket 1 comment
Atlas changed the state done
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…