Styles belong in each component's Style {} block, not in styles.hl
opened by Atlas · assigned to Caramboleyo
opened · updated
caramboleyo, 2026-10-25: "Do all you apps misuse the framework and put all styles in styles.hl instead of making proper Style {} blocks inside the componet files?"
Yes. Count today: 5 of 16 component files have their own Style block; components/styles.hl is 19.8 KB.
Fix: every component gets its own Style {} block in its own file. styles.hl keeps only the theme inherit, the app accent and rules for plain page elements that belong to no component. The pages must look exactly the same afterwards (before and after screenshots of every control at phone and desktop width).
History
Atlas opened the ticket 1 comment
Atlas assigned the ticket to Caramboleyo Atlas changed the state review 1 comment
Caramboleyo
Caramboleyo changed the state reopened 2 comments
Atlas edited
Edited once
You are right: each rule has all its declarations on one line, rules are repeated flat as quoted selectors instead of nested like the View, and classes are used where the elements own rules belong. Arachne reviewed the file with me and wrote the correct form down. The rewrite starts when her fix for nested @media (hybriel#257) is in the language, because the media queries must be nested in the same go. Then tickets first, the other apps after.
Tickets edited
Edited once
Live on tickets.worldapi.org since today. Every component's Style block is now written in the language's form: one declaration per line, nested like the View, rules named after the component's own elements, @media nested in the rule it changes. **Test:** 1. Read the Style block in components/ticket_list.hl (then ticket.hl or you.hl) in the tickets repo, main bc2fde3. 2. Open https://tickets.worldapi.org/tickets.worldapi.org at phone width and wide: it should look the same as before. **Details:** - 49 selectors are still quoted, each with a one-line reason above it, because the language has no form for them yet (for example ticket-state.open, a class set from a value, and selectors into other components). - The 7 repeated a.selected.<state> rules are gone. The → before the assignee is now text in the page. - Before/after comparison in your Chrome: 84 of 100 screenshots identical, 16 differ by a few pixels of that →.
Tickets changed the state review
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
edited
Edited once
Done and live (commit 090ee80): every component now has its own nested Style {} block in its own file (main, ticket_list, ticket, inbox, you, settings, connect, new_project, markdown), written the way the language wants it, with the names of the elements in the View. components/styles.hl went from about 150 rules (19.8 KB) to 6 site-wide rules (2.3 KB): the theme inherit, the accent, plain time/form rules and the shared .hint/.message/.notice classes. The pages look exactly the same: 88 before/after screenshot pairs in your Chrome at 390, 800x1280, 1280x800 and 1280x900 differ by 0 pixels, and the generated CSS is the same rule for rule. Please check: the compound class selectors (state colours like ticket-state.review, filter chips) are still quoted, because the language has no nested form for a class on the same element.Write…