fix(css): move user-facing classes to styled surfaces#95
Merged
Conversation
…patibility Move the user-facing .widget class from the outer container to the visual surface element, and rename the container to .widget-wrapper. This preserves the documented .widget CSS contract so user stylesheets targeting .widget continue to hit the background element. Key changes: - .widget now lives on the visual surface (background + border-radius) - .widget-wrapper is the outer rectangular hit target (Fitts's Law) - Widget css_name added to both wrapper and surface for per-widget overrides - Groups: .widget-group moved to surface; nested widget backgrounds forced transparent via scoped CSS provider at TRANSIENT_CSS_PRIORITY - Merge group negative margin rule extended to .widget-merge-group - Passive widget padding selector added - Overlay overflow:hidden for standalone widget ripple clipping
ScaleBox didn't override request_mode(), defaulting to ConstantSize. Its child (popover content with wrapping labels) needs HeightForWidth, so GTK measured height assuming unlimited width then allocated too little once text wrapped — producing a scrollbar on short lists. Forward the child's request mode to fix. The overlay scrollbar also overlapped dismiss buttons. Remove right padding from the popover surface and apply it individually to the header and notification list, so the scrollbar sits in the reclaimed gutter without needing negative margins.
…ntainers Notification toasts, OSD overlays, and popovers had CSS classes on transparent gtk4::Window or wrapper elements instead of on the visual surface. Users targeting these classes got double backgrounds and sharp corners. Move .notification-toast, .osd, and .popover to the inner styled containers, add -wrapper classes to transparent shells, and fix a bare box CSS selector in apply_surface_styles_inner that leaked styles to all descendant GtkBox widgets. Going forward: - .popover is the canonical class for all popover surfaces (layer-shell and native). .vp-surface-popover and .widget-menu are deprecated aliases kept for backward compat — remove after a few releases. - .widget-menu must remain on native gtk4::Popover shells (needed by the popover.widget-menu CSS reset rules in css/base.rs). Only the user-facing role is deprecated; the structural role stays. - .osd-window was removed entirely (undocumented, wrong element). - Wiki needs updating to document .popover, .osd, .notification-toast and mark deprecated classes.
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.
Fixes CSS class regressions introduced after v0.12.1 where user-facing classes (
.widget,.clock,.notification-toast, etc.) ended up on transparent wrappers/windows instead of the painted surfaces..widget-surfaceback to.widget, outer click targetbecomes.widget-wrapper.clock,.cpu, etc.) from wrapper to surface so user CSS like.clock { background: ... }works again.popoveras canonical popover class. Keep.vp-surface-popoverand.widget-menuas deprecated aliases.osdfor OSD styling, window becomes.osd-wrapperFixes #90