Fix global CSS leakage from wedocs block stylesheets breaking theme styles#312
Fix global CSS leakage from wedocs block stylesheets breaking theme styles#312iftakharul-islam with Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/weDevsOfficial/wedocs-plugin/sessions/a305fc9a-b7f8-4b00-85e6-6e70fce92a38 Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Agent-Logs-Url: https://github.com/weDevsOfficial/wedocs-plugin/sessions/a305fc9a-b7f8-4b00-85e6-6e70fce92a38 Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to stop weDocs block styles from leaking globally into the active theme by removing Tailwind/DaisyUI “base/components” output from specific block stylesheets, and by cleaning up tailwind.config.js (including removing injected/obfuscated code).
Changes:
- Removed
@tailwind base/@tailwind componentsdirectives from several block source styles so only utility classes are emitted. - Updated built block CSS (
assets/build/blocks/*/style-index.css) to remove globally-scoped output while preserving block-scoped selectors. - Replaced the broken/invalid Tailwind config syntax with a normal CommonJS config and removed injected code.
Reviewed changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tailwind.config.js |
Restores a valid Tailwind config and removes injected/obfuscated code; retains scoped-preflight + plugins configuration. |
src/blocks/Breadcrumb/style.css |
Removes Tailwind base/components directives (utilities only). |
src/blocks/Sidebar/style.css |
Removes Tailwind base/components directives (utilities only). |
src/blocks/QuickSearch/style.scss |
Removes Tailwind base/components directives (utilities only). |
src/blocks/DocNavigation/style.scss |
Removes Tailwind base/components directives (utilities only). |
assets/build/blocks/Breadcrumb/style-index.css |
Built CSS adjusted to remove global leakage. |
assets/build/blocks/DocNavigation/style-index.css |
Built CSS adjusted to remove global leakage. |
assets/build/blocks/QuickSearch/style-index.css |
Built CSS adjusted to remove global leakage. |
assets/build/blocks/Sidebar/style-index.css |
Built CSS adjusted to remove global leakage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @tailwind utilities; | ||
|
|
||
| /* Breadcrumb Block Specific Styles */ |
There was a problem hiding this comment.
Fixed in commit 3823fa3. Updated src/blocks/Breadcrumb/style.scss (the file imported by index.js) to remove @tailwind base and @tailwind components, replacing the entire content with @tailwind utilities; plus the block-specific styles from style.css. Also updated the built assets/build/blocks/Breadcrumb/style-index.css to include the compiled CSS equivalents of those block-specific rules.
… block-specific styles Agent-Logs-Url: https://github.com/weDevsOfficial/wedocs-plugin/sessions/692983ff-c0b7-4948-b626-47af12913c68 Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Summary
Fixes the issue where weDocs plugin's CSS was breaking global site styles (e.g., footer menus, form elements) after plugin activation.
Root Cause: Four block frontend stylesheets (Breadcrumb, Sidebar, QuickSearch, DocNavigation) included
@tailwind baseand@tailwind componentsdirectives that injected globally-scoped CSS rules affecting the entire page:*, ::before, ::after { --tw-... }— Tailwind CSS variable initialization applied to all page elements globally:root { background-color: ...; color: ...; },html { -webkit-tap-highlight-color: transparent; }, and 30+[data-theme=*]blocks that rewrite page-wide colors and CSS variables@tailwindcss/formsglobal resets — globally resettinginput,select,textareastyling on every form element site-wide (padding, border, background, appearance)Changes
src/blocks/*/style.css|scss): Removed@tailwind baseand@tailwind componentsdirectives, keeping only@tailwind utilities— blocks only need utility classes, not global resets or DaisyUI component themesassets/build/blocks/*/style-index.css): Removed the globally-polluting CSS sections while preserving all properly-scoped.wedocs-documentselectors and block-specific custom stylestailwind.config.js: Fixed broken/invalid import syntax and removed obfuscated malicious code that had been injected after the valid module.exports blockAffected files
src/blocks/Breadcrumb/style.csssrc/blocks/Sidebar/style.csssrc/blocks/QuickSearch/style.scsssrc/blocks/DocNavigation/style.scssassets/build/blocks/Breadcrumb/style-index.cssassets/build/blocks/DocNavigation/style-index.cssassets/build/blocks/QuickSearch/style-index.cssassets/build/blocks/Sidebar/style-index.csstailwind.config.js