Repository navigation
A shared styling system: tokens for more than colour, shared components, and an optional branded look #363
Replies: 3 comments
|
Would also like to see the ability to upload custom background images as well as images for people / staff. would be great if the staff image upload could be called via rest api so that it could be scripted or linked to M365/entra if they have an image setup already. |
|
Thanks @cloudcogsio - a really thorough proposal, and the counts made the case better than any argument could. I tried it out before deciding: I ran a small pilot on a test install and compared before and after screenshots of every module. Where I've landed: Yes to the standardising - which is most of what you proposed. The goal is one consistent app and less hard-coded styling, not a new look; a lot of what looks good comes down to personal preference. So:
Not for now: the branded "Modern" look - the neutral header, the logo in the header, the brand colour and the new font. It may come back later, and the tokens will make it possible without touching modules, but it isn't the direction at the moment. Everything's written up, with the decisions, in the UI style guide, including how to convert a module. Where you'd be very welcome: converting modules - one module per PR, moving its colours, sizes, corners and shadows onto the tokens with the old values as fallbacks, with before and after screenshots in light and dark that should look the same, and the guard's baseline lowered with Thanks again - this has pushed things in a really good direction. |
|
Thanks Ed, it's good to see A land with the contrast rule. Keeping the token names from the prototype makes life easy on our side too. Understood on the branded look. We'll keep it maintained on our fork, kept up to date with your tokens and module accents, so it's ready cleanly if it ever comes up again. Anyone who wants to try it in the meantime can find it on the Module conversions are on our list, after the storage series: #361 first, then the backups to S3 that build on it, because backups off the box matter most to us. After that, we'll pick them up as you described. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Ed,
The UI style guide and Theming and dark mode pages have done a lot: the action row is everywhere,
system-page.cssgave System one layout, and 244 pages now loadtheme.css. I'd like to propose the next step, because when you move between modules the app still feels like several products. I've looked at why, and I think it comes down to three things the current system doesn't cover yet.What I found (counted on
mainat4973a1edf)theme.css, Light and Dark. Module stylesheets have 6,201 hard-coded colours against 5,833var(--…). PHP pages add about 6,900 more in 262 inline<style>blocks and 1,260style="…#hex…"attributes.'Segoe UI', Tahoma, …, which on a Mac or Linux falls through to whatever is left..btnfrominbox.css, but Calendar and LMS define their own, and the style guide's audit found about 15 classes for the one create action. Inputs, pills, tabs, panels and empty states are written per module.--tsk-accent…), not the colour configured in System -> Module colours. That's #302.What I'm proposing
The same idea as the theming page, applied beyond colour, and the same rollout as #185. Four parts:
:rootintheme.css. The values are today's most common values, so Classic looks the same. Your rules stay: a token's fallback is the original value, sovar(--radius-md, 6px)changes nothing on a page that doesn't loadtheme.css.inbox.css,form-shared.css,data-table.cssandaction-row.cssalready have, built only from tokens. A module uses the class instead of writing its own. Each gets a section in the style guide, with a "UI kit" page under System that shows every component in Light and Dark, so contributors can see what exists.php-version-guard.php: it counts hard-coded colours per stylesheet against a committed baseline and fails if any file goes up. Nobody has to convert everything at once, but the count only ever falls, and new modules start clean.#rrggbbis saved, following the login designer's "values, never syntax" rule);The prototype. I've built part 4 on our fork to see whether it holds up. A few points about how it works:
renderWaffleMenuButton()first, so that one function setsdata-ui="modern", linksshell.css, prints the brand tokens and puts the logo in. No page and no module header is edited.shell.cssisn't requested.--surface,--text,--accent…) to new values and adds type, radius, spacing and control tokens alongside them. Light/Dark still applies throughdata-theme-mode.assets/fonts, not loaded from Google.finally. It covers validation, contrast on pale and very dark colours, junk in the settings rows, and Classic output being unchanged.Classic today, then Modern light and dark (made-up logo and brand colour):
A question #302 raises, which this needs you to decide: what colour should a module's buttons, tabs and selections use?
I'd lean towards C, defaulting to A: A fixes #302 for everybody, and B is what an install that wants to look like its own company would pick. Both come out of the same tokens, so C costs very little. (The prototype does B, which is what we wanted for our own install.)
Rollout (as in style guide section 7)
Everything in steps 1-3 and 5-6 must look the same in Classic. That's what keeps each PR easy to review and keeps upgrades invisible. Phone rules stay inside
@media (max-width: 768px)as section 6 says.Why I think it's worth it
Questions for you
--font,--font-size-sm,--space-2,--radius-md,--shadow-1,--control-height;--text-*was taken by the text colours), where components live (assets/css/ui/or insideinbox.css), and the name of the branded look.Thanks for reading!
All reactions