Skip to content

Fix global CSS leakage from wedocs block stylesheets breaking theme styles#312

Open
iftakharul-islam with Copilot wants to merge 4 commits into
developfrom
copilot/fix-menu-footer-breaking-issue
Open

Fix global CSS leakage from wedocs block stylesheets breaking theme styles#312
iftakharul-islam with Copilot wants to merge 4 commits into
developfrom
copilot/fix-menu-footer-breaking-issue

Conversation

Copilot AI commented May 8, 2026

Copy link
Copy Markdown
Contributor

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 base and @tailwind components directives that injected globally-scoped CSS rules affecting the entire page:

  1. *, ::before, ::after { --tw-... } — Tailwind CSS variable initialization applied to all page elements globally
  2. DaisyUI global theme rules:root { background-color: ...; color: ...; }, html { -webkit-tap-highlight-color: transparent; }, and 30+ [data-theme=*] blocks that rewrite page-wide colors and CSS variables
  3. @tailwindcss/forms global resets — globally resetting input, select, textarea styling on every form element site-wide (padding, border, background, appearance)

Changes

  • Source CSS (src/blocks/*/style.css|scss): Removed @tailwind base and @tailwind components directives, keeping only @tailwind utilities — blocks only need utility classes, not global resets or DaisyUI component themes
  • Built CSS (assets/build/blocks/*/style-index.css): Removed the globally-polluting CSS sections while preserving all properly-scoped .wedocs-document selectors and block-specific custom styles
  • tailwind.config.js: Fixed broken/invalid import syntax and removed obfuscated malicious code that had been injected after the valid module.exports block

Affected files

  • src/blocks/Breadcrumb/style.css
  • src/blocks/Sidebar/style.css
  • src/blocks/QuickSearch/style.scss
  • src/blocks/DocNavigation/style.scss
  • assets/build/blocks/Breadcrumb/style-index.css
  • assets/build/blocks/DocNavigation/style-index.css
  • assets/build/blocks/QuickSearch/style-index.css
  • assets/build/blocks/Sidebar/style-index.css
  • tailwind.config.js

Copilot AI and others added 2 commits May 8, 2026 11:36
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 components directives 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.

Comment on lines 1 to 3
@tailwind utilities;

/* Breadcrumb Block Specific Styles */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants