Skip to content

Conversation

@sapayth
Copy link
Member

@sapayth sapayth commented Nov 11, 2025

fixes #1735

introduced tailwindcss-scoped-preflight package to scope our tailwindcss classes. It will reduce conflict with other themes/plugins css

Summary by CodeRabbit

  • Chores
    • Updated styling configuration and build tooling dependencies to improve styling management across the application.

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Walkthrough

Adds tailwindcss-scoped-preflight as a devDependency and configures it in the Tailwind CSS configuration to isolate preflight styles within specific WPUF-related selectors, targeting subscription page, form builder, and related components to prevent theme conflicts.

Changes

Cohort / File(s) Summary
Dependency Addition
package.json
Adds tailwindcss-scoped-preflight@^3.4.12 to devDependencies
Tailwind Plugin Configuration
tailwind.config.js
Imports scopedPreflightStyles and isolateInsideOfContainer from the new package; configures plugin with isolation strategy targeting .wpuf_packs, #wpuf-subscription-page, #wpuf-form-builder, and #wpuf-profile-forms-list-table-view selectors to scope CSS resets

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify that the duplicate require('@tailwindcss/forms') entry in the plugins array is intentional or should be removed
  • Confirm that the four targeted selectors are complete and accurate for the subscription page styling fix
  • Test the scoped preflight functionality across the affected pages to ensure no unintended style regressions

Suggested labels

needs: dev review

Poem

🐰 A scoped preflight hops into view,
Preflight styles now bound tight and true,
Four selectors tamed with CSS care,
No theme conflicts floating in air!
Subscriptions fixed with tailored flair! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The addition of tailwindcss-scoped-preflight and its configuration appears related to the CSS scoping solution, though the changes include a duplicate require('@tailwindcss/forms') entry that seems unintended. Remove the duplicate require('@tailwindcss/forms') entry in the plugins array, as it appears to be an unintended duplication.
Title check ❓ Inconclusive The title refers to fixing the subscription page title issue but the changes implement CSS scoping infrastructure that may not directly address the visual styling problem. Clarify whether CSS scoping alone fixes the broken title styling, or if additional styling/HTML changes are needed to resolve issue #1735.
Linked Issues check ❓ Inconclusive The PR adds tailwindcss-scoped-preflight to scope CSS classes within specific selectors including '#wpuf-subscription-page', but no evidence shows the actual styling changes that fix the broken title. Verify that the CSS scoping configuration alone resolves the subscription page title styling issue, or confirm additional style modifications exist.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61f733e and b997ecb.

⛔ Files ignored due to path filters (6)
  • assets/js/ai-form-builder.min.js is excluded by !**/*.min.js
  • assets/js/forms-list.min.js is excluded by !**/*.min.js
  • assets/js/forms-list.min.js.map is excluded by !**/*.map, !**/*.min.js.map
  • assets/js/frontend-subscriptions.min.js is excluded by !**/*.min.js
  • assets/js/subscriptions.min.js is excluded by !**/*.min.js
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • tailwind.config.js (2 hunks)
🔇 Additional comments (2)
tailwind.config.js (1)

34-43: The empty options object is correct and intentional.

The isolateInsideOfContainer strategy accepts optional configuration parameters including except, rootStyles, remove, and ignore. The empty object {} means the code is using all default values, which is perfectly valid. The default behavior (particularly rootStyles: "move to container") aligns well with the goal of isolating Tailwind's preflight styles within the specified containers. No configuration changes are needed.

package.json (1)

46-47: Dependency compatibility verified—no issues found.

The addition of tailwindcss-scoped-preflight version ^3.4.12 is secure and compatible:

  • No known security vulnerabilities
  • Peer dependency tailwindcss ^3 is satisfied by your existing ^3.3.5
  • Peer dependency postcss ^8 is satisfied by your existing ^8.4.31

Comment on lines +3 to +6
import {
scopedPreflightStyles,
isolateInsideOfContainer,
} from 'tailwindcss-scoped-preflight';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Mixed module syntax may cause issues.

This file mixes ES module syntax (import) with CommonJS syntax (require on lines 1, 32-33, 44). While some build tools support this, it can lead to compatibility issues or unexpected behavior.

Consider using consistent module syntax throughout the file. Apply this diff to convert to CommonJS:

-import {
-    scopedPreflightStyles,
-    isolateInsideOfContainer,
-} from 'tailwindcss-scoped-preflight';
+const {
+    scopedPreflightStyles,
+    isolateInsideOfContainer,
+} = require('tailwindcss-scoped-preflight');
📝 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.

Suggested change
import {
scopedPreflightStyles,
isolateInsideOfContainer,
} from 'tailwindcss-scoped-preflight';
const {
scopedPreflightStyles,
isolateInsideOfContainer,
} = require('tailwindcss-scoped-preflight');
🤖 Prompt for AI Agents
In tailwind.config.js around lines 3 to 6 (and note existing CommonJS usage at
lines 1, 32-33, 44), the file mixes ES module import syntax with CommonJS
requires; convert the ES imports to CommonJS by replacing the import statement
with a const { scopedPreflightStyles, isolateInsideOfContainer } =
require('tailwindcss-scoped-preflight'); and ensure the rest of the file
continues to use module.exports/require consistently (or alternatively convert
all require usages to import/export if you prefer ESM), keeping a single module
system throughout.

], {}
),
} ),
require('@tailwindcss/forms'),
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove duplicate plugin registration.

The @tailwindcss/forms plugin is already registered on line 32. This duplicate registration on line 44 will cause the plugin to be loaded twice, which may lead to unexpected behavior or warnings.

Apply this diff to remove the duplicate:

         scopedPreflightStyles( {
             isolationStrategy: isolateInsideOfContainer(
                 [
                     '.wpuf_packs',
                     '#wpuf-subscription-page',
                     '#wpuf-form-builder',
                     '#wpuf-profile-forms-list-table-view'
                 ], {}
             ),
         } ),
-        require('@tailwindcss/forms'),
     ],
📝 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.

Suggested change
require('@tailwindcss/forms'),
scopedPreflightStyles( {
isolationStrategy: isolateInsideOfContainer(
[
'.wpuf_packs',
'#wpuf-subscription-page',
'#wpuf-form-builder',
'#wpuf-profile-forms-list-table'
], {}
),
} ),
],
🤖 Prompt for AI Agents
In tailwind.config.js around line 44, the @tailwindcss/forms plugin is
registered twice (also at line 32); remove the duplicate
require('@tailwindcss/forms') entry at line 44 so the plugin is only listed once
in the plugins array, keeping the original registration at line 32 intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Subscription page title is broken

1 participant