Split CSS file into smaller ones
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
The [current stylesheet](https://github.com/LMMS/lmms/blob/stable-1.2/data/themes/default/style.css) is almost 1000 lines long. That is quite a lot. I'd like to suggest to split it into smaller files by the top level widget the styles are affecting.
For example
```css
QTreeView {
outline: none;
}
QTreeWidget::item:hover,
QTreeWidget::branch:hover {
background-color: #3C444E;
}
```
would go into a `QTreeWidget.css`.
Some styles that affect a group of unrelated widget may still end up in a special `global.css` such as these lines:
```css
QLabel, QTreeWidget, QListWidget, QGroupBox, QMenuBar {
color: #d1d8e4;
}
```
Hopefully these will relatively few though.
---
The advantages of splitting into smaller files would be:
- merge conflicts are less likely to happen
- styles for a certain component are easier to find (`AutomationEditor.cpp` --> `AutomationEditor.css`)
In the future this may also allow to inherit from the default theme and only override the styles for some components.
---
The technical side of this is fairly simple: Because the Qt Resource System allows to list files in the resource directories, we can simply load all `*.css` files.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with data/themes/default/style.css and review how the Qt Resource System loads files from resource directories. Group styles by their top-level widget into separate CSS files, keeping shared selectors in a global.css where needed, and verify that all stylesheet files are loaded correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- design, desktop
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100