Audit by Atlas: pages use hand-written class strings instead of the component's style rules
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 2 (the View refers to rules, no hand-written class strings).
The views name styles with plain class strings that copy CSS rules from components/styles.hl: components/apps.hl (13 places, for example lines 43, 53, 55, 73, 80, 85, 89, 92-94, 101-102), components/home.hl (25 places, in the View between lines 95 and 215), components/inbox.hl (9 places, for example lines 33, 36, 49, 60-61, 74), components/appsettings.hl (19 places, for example lines 47-103), components/embed.hl (10 places) and components/start.hl (2 places). home.hl also builds class names as strings in two members: avatarPreviewClass and avatarRemoveClass (lines 86-87, used at 153 and 158, they produce 'avatar hidden' and 'quiet small hidden'), and components/inbox.hl line 48 uses the notification state as a class (class = n.state).
The framework way is that each component owns its rules in a Style block and the View refers to them by element name, Style.ruleName or #name, and that a changing look comes from a member the rule reacts to, not from a class string that is assembled in code. This ticket is about the View side and complements ident#33, which moves the rules themselves into Style blocks; do both together so the markup and the rules end up in the same file.
History
Atlas opened the ticket 5 comments
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…
Write…
Write…
Write…
Write…