Common styles between dark and light theme should live in a different file
Categories
(DevTools :: Shared Components, defect)
Tracking
(Not tracked)
People
(Reporter: jsantell, Unassigned)
References
(Blocks 1 open bug)
Details
Updated•10 years ago
|
Comment 1•10 years ago
|
||
Updated•7 years ago
|
Comment 2•6 years ago
|
||
I'd like to work on this.
Would it be a good idea to take everything that is identical in light|dark-theme.css and move it:
- to a specific component stylesheet if it seems to override styles for a specific component
- to common.css otherwise
?
Tim, any advice?
Comment 3•6 years ago
|
||
Hey Florens, thanks for looking into this! As Brian says in comment 1, it would be a good idea to first unify both files to be identical (by re-using or creating CSS variables).
Regarding component stylesheets vs common.css, it really depends on how we prefer maintaining this code:
Moving things in component stylesheets is less prone to leaving unused code behind, since component CSS files are removed along with their JS counterpart, but also more prone to styling inconsistencies/code duplication.
Having everything in common.css allows less code/variable duplication, hence less styling inconsistencies thanks to code sharing, but also is more prone to leaving unused code behind.
I would personally put what's unlikely to become unused in a shared.css/common.css file (body {margin: 0}, .theme-body, .theme-sidebar, .devtools-toolbar, etc.). And stuff specific to a component (.variable-or-property - eg. old variables view stuff, .rule/computedview-swatch) in the component CSS. I'm less categorical about the CM stuff because there really isn't any component CSS file for it and it's also unlikely going to become unused :).
But honestly, either way or a mix of both is fine as long as the concerns are addressed one way or another (doesn't necessarily have to be in how files are split, can also be in documentation/tooling etc). I've mentioned the preferences which work out well for me, since they try to minimize all the concerns I mentioned above without extra doc/tooling effort, but they might not work as well for others.
Updated•6 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Description
•