wedocs-plugin icon indicating copy to clipboard operation
wedocs-plugin copied to clipboard

enhance: scope tailwindcss styles

Open sapayth opened this issue 2 months ago • 1 comments
trafficstars

fix css conflicts with other themes or plugins

related issue #170

Summary by CodeRabbit

  • Style

    • Scoped styles applied to the documentation area to prevent CSS conflicts, improving visual consistency across themes and plugins.
    • Minor UI adjustment: action menus now respect content width for better layout and alignment.
  • Chores

    • Build tooling updated to add a scoped preflight plugin for Tailwind CSS and cleaned up development dependencies.

sapayth avatar Sep 25 '25 07:09 sapayth

Walkthrough

Minor formatting-only change in includes/Admin.php (trailing newline removed); added Tailwind scoped-preflight integration and root class in config and package deps; small UI class tweak in src/components/DocActions.js (added w-max).

Changes

Cohort / File(s) Summary
Admin file formatting
includes/Admin.php
Trailing newline removed at end of file; no functional changes.
Build / Tailwind config
package.json, tailwind.config.js
Added tailwindcss-scoped-preflight to devDependencies (removed duplicate block-editor entry). Imported scoped preflight utilities in tailwind.config.js, introduced const rootClass = '.wedocs-document', set important to rootClass, and added scopedPreflightStyles(isolateInsideOfContainer(rootClass, {})) to plugins alongside existing plugins.
UI class tweak
src/components/DocActions.js
Added w-max to the action menu container className to constrain menu width; no logic or event changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through code so bright,
A newline vanished out of sight.
Tailwind dons a scoped small crown,
Menus snug with width pulled down.
Carrots for builds and bytes tonight! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely reflects the main change of adding scoped Tailwind CSS styles, matching the modifications in the Tailwind configuration and related files.
✨ Finishing touches
  • [ ] 📝 Generate Docstrings
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3b2806f49944824bdd100904fb29527b32d400b and f0db9a701040326593e1e2b976b6756d927a7e38.

📒 Files selected for processing (1)
  • includes/Admin.php (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • includes/Admin.php

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Sep 25 '25 07:09 coderabbitai[bot]