fix(css): exclude webgui styles from buttons/selects in api components#2543
fix(css): exclude webgui styles from buttons/selects in api components#2543Ajit-Mehrotra wants to merge 1 commit intomasterfrom
Conversation
WalkthroughA CSS file narrowing the scope of button and select element styles by wrapping selectors with Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
emhttp/plugins/dynamix/styles/default-base.css (2)
2303-2343:⚠️ Potential issue | 🟠 MajorHover, active, and disabled state selectors for
button/a.buttonare not excluded for.unapi.The base styles (line 2277–2279) correctly exclude
.unapi *elements, but the corresponding hover (2306–2308), active (2318–2320), and disabled (2326–2336) selectors forbutton,button[type="button"], anda.buttonare still unscoped. This means API component buttons will lose their base sidebar styles but still pick up sidebar hover/active/disabled overrides — likely causing visual inconsistencies.The same
:where(:not(.unapi *))pattern should be applied to these state selectors as well forbutton,button:hover,button:active,button[disabled], etc.
2349-2376:⚠️ Potential issue | 🟡 MinorSelect derivative selectors (
option,option:disabled,select[disabled]) not excluded.Line 2349 correctly scopes the base
selectwith:where(:not(.unapi *)), but the subsequentselect option(2363),select option:disabled(2368), andselect[disabled](2372) selectors remain unscoped. While the baseselectstyles won't apply, these child/state selectors will still match.unapiselect elements and apply sidebar-specific option colors and disabled styles.Proposed fix
- select option { + select:where(:not(.unapi *)) option { color: var(--text-color); background-color: var(--opac-background-color); } - select option:disabled { + select:where(:not(.unapi *)) option:disabled { color: var(--disabled-text-color); } - select[disabled] { + select[disabled]:where(:not(.unapi *)) { color: var(--disabled-text-color); border-color: var(--disabled-input-border-color); background-color: var(--disabled-input-background-color); }
🤖 Fix all issues with AI agents
In `@emhttp/plugins/dynamix/styles/default-base.css`:
- Around line 2274-2279: The rule inconsistently excludes API components: add
the same :where(:not(.unapi *)) exclusion to the input selectors so
input[type="button"], input[type="reset"], and input[type="submit"] are wrapped
the same way as button, button[type="button"], and a.button; update the selector
list containing input[type="button"], input[type="reset"], input[type="submit"],
button:where(:not(.unapi *)), button[type="button"]:where(:not(.unapi *)),
a.button:where(:not(.unapi *)) so the input[type=...] selectors include
:where(:not(.unapi *)) (or alternatively add separate
input[type="..."]:where(:not(.unapi *)) entries) to ensure API (.unapi) children
are consistently excluded.
| input[type="button"], | ||
| input[type="reset"], | ||
| input[type="submit"], | ||
| button, | ||
| button[type="button"], | ||
| a.button { | ||
| button:where(:not(.unapi *)), | ||
| button[type="button"]:where(:not(.unapi *)), | ||
| a.button:where(:not(.unapi *)) { |
There was a problem hiding this comment.
Inconsistent exclusion: input[type] selectors in the same rule are not wrapped with :where(:not(.unapi *)).
Lines 2274–2276 (input[type="button"], input[type="reset"], input[type="submit"]) are left unmodified while button, button[type="button"], and a.button on lines 2277–2279 are wrapped. If API components can also contain <input type="button|reset|submit"> elements, those will still receive the sidebar overrides.
Proposed fix for consistency
- input[type="button"],
- input[type="reset"],
- input[type="submit"],
- button:where(:not(.unapi *)),
- button[type="button"]:where(:not(.unapi *)),
- a.button:where(:not(.unapi *)) {
+ input[type="button"]:where(:not(.unapi *)),
+ input[type="reset"]:where(:not(.unapi *)),
+ input[type="submit"]:where(:not(.unapi *)),
+ button:where(:not(.unapi *)),
+ button[type="button"]:where(:not(.unapi *)),
+ a.button:where(:not(.unapi *)) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| input[type="button"], | |
| input[type="reset"], | |
| input[type="submit"], | |
| button, | |
| button[type="button"], | |
| a.button { | |
| button:where(:not(.unapi *)), | |
| button[type="button"]:where(:not(.unapi *)), | |
| a.button:where(:not(.unapi *)) { | |
| input[type="button"]:where(:not(.unapi *)), | |
| input[type="reset"]:where(:not(.unapi *)), | |
| input[type="submit"]:where(:not(.unapi *)), | |
| button:where(:not(.unapi *)), | |
| button[type="button"]:where(:not(.unapi *)), | |
| a.button:where(:not(.unapi *)) { |
🤖 Prompt for AI Agents
In `@emhttp/plugins/dynamix/styles/default-base.css` around lines 2274 - 2279, The
rule inconsistently excludes API components: add the same :where(:not(.unapi *))
exclusion to the input selectors so input[type="button"], input[type="reset"],
and input[type="submit"] are wrapped the same way as button,
button[type="button"], and a.button; update the selector list containing
input[type="button"], input[type="reset"], input[type="submit"],
button:where(:not(.unapi *)), button[type="button"]:where(:not(.unapi *)),
a.button:where(:not(.unapi *)) so the input[type=...] selectors include
:where(:not(.unapi *)) (or alternatively add separate
input[type="..."]:where(:not(.unapi *)) entries) to ensure API (.unapi) children
are consistently excluded.
For the upcoming onboarding flow in 7.3
Summary by CodeRabbit