Add module class to the root elements of the modules - #2921
Merged
Merged
Conversation
Ensure that the position and the corresponding CSS class on window are always set.
Previously, the only way to select all the module labels was with the
following kind of selector:
```css
.modules-left > widget > label,
.modules-center > widget > label,
.modules-right > widget > label {
/* ... */
}
```
(and a matching block for the `box` containers).
Now, this can be expressed as
```css
label.module, box.module {
/* ... */
}
```
Alexays
approved these changes
Feb 16, 2024
Owner
|
LGTM thx :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At some point, my draft style for Fedora configuration was looking like that:
Warning: ugly CSS fragment inside
(Actually, it was worse - there's also a
.modules-xxx > widget > box. And#image)Two obvious ideas to optimize that:
:not(.bottom):not(.left):not(.right)can be shortened to.top.label.module/box.module/etc...After that, the style was reduced to a rather tolerable
Part of
bar.cpprefactoring should also simplify adding support forpositionproperty of Sway IPC (seesway-bar(5)/get_bar_configinsway-ipc(7)). But that functionality does not belong here and is not finished yet.A Styling wiki update could look like that (after Module Group Styling):
Generic module style
A style with the
.moduleselector would affect all the modules. In practice, you may prefer to use more specificlabel.moduleandbox.moduleselectors.You need to remember about selector specificity when overriding the style for a specific module: