LMMS / LMMS/lmms

Split CSS file into smaller ones

Open
#5,120 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.