Skip to content

Conversation

@Sqrcz
Copy link
Collaborator

@Sqrcz Sqrcz commented Mar 17, 2025

TailwindCSS v4 is here!

Summary by CodeRabbit

  • New Features

    • Introduced a custom documentation theme with organized CSS layers and dark mode support.
    • Updated the quickstart guide to include the FwbAlert component and clarified Tailwind CSS installation instructions.
  • Style

    • Updated shadow styling across buttons, dropdowns, modals, toasts, and footers for a refined look.
    • Integrated Tailwind CSS for streamlined, utility-first styling.
  • Refactor

    • Streamlined configuration settings by replacing legacy integrations with updated Tailwind plugins.
  • Chore

    • Upgraded multiple dependencies to support Tailwind CSS v4 and the latest build tooling.
    • Removed outdated configuration files and settings related to Tailwind CSS.

@Sqrcz Sqrcz added 🔧 enhancement New feature or request 🤖 maintenance dependency updates, releases labels Mar 17, 2025
@Sqrcz Sqrcz self-assigned this Mar 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

Walkthrough

This update refines the Tailwind CSS integration and streamlines theme configurations. The PostCSS setup now uses a Tailwind CSS PostCSS plugin, and both Vite and ESLint configurations have been updated accordingly. New theme customization files were added while legacy theme and Tailwind configuration files were removed. Additionally, several UI components have had their shadow-related classes adjusted, and various dependency versions were bumped in package.json.

Changes

File(s) Change Summary
docs/.postcssrc.js Updated Tailwind plugin configuration from tailwindcss: {} to @tailwindcss/postcss: {}.
docs/…/theme/{custom.css, index.js, index.ts, tailwind.css} Added new theme files (custom.css, index.js) and removed legacy files (index.ts, tailwind.css) for VitePress.
docs/vite.config.ts, vite.config.ts Integrated the Tailwind CSS plugin via @tailwindcss/vite in the Vite configuration.
eslint.config.js Removed the Tailwind-specific ESLint configuration (tailwindConfig).
package.json Upgraded dependency versions: updated Tailwind CSS from ^3 to ^4, added @tailwindcss/postcss and @tailwindcss/vite, and bumped versions for several dev and runtime packages.
src/components/{FwbButtonGroup.vue, FwbDropdown/composables/useDropdownClasses.ts, FwbFooter.vue, FwbModal.vue, FwbToast/composables/useToastClasses.ts} Adjusted shadow classes in UI components (e.g., changed shadow to shadow-sm or from shadow-sm to shadow-xs in FwbButtonGroup) and added a CSS import in FwbButtonGroup.vue.
src/style.css Added an import line for the Tailwind CSS framework.
tailwind.config.js Removed the Tailwind CSS configuration file (including the Flowbite plugin setup).

Suggested labels

📚 documentation

Poem

I’m a code bunny, hopping with delight,
Changing shadows from dim to light.
Old theme files vanish in a gentle sweep,
New plugins and styles now proudly leap.
With upgrades and tweaks, I dance through the code,
A joyful rabbit on a streamlined road! 🐇
Happy coding in our leafy abode!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for sensational-seahorse-8635f8 ready!

Name Link
🔨 Latest commit 01809f5
🔍 Latest deploy log https://app.netlify.com/sites/sensational-seahorse-8635f8/deploys/67db3972c576cc00086c04ba
😎 Deploy Preview https://deploy-preview-360--sensational-seahorse-8635f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@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

🧹 Nitpick comments (5)
src/style.css (1)

1-1: Ensure Correct Import Syntax for Tailwind CSS v4.
The added line @import 'tailwindcss'; is intended to integrate Tailwind CSS v4. Please verify that this import syntax aligns with Tailwind v4’s best practices. In recent versions, Tailwind often recommends using the @tailwind directives (e.g., @tailwind base;, @tailwind components;, @tailwind utilities;) if that better suits your configuration.

docs/.vitepress/theme/index.js (1)

1-6: Review Import Order and Theme Integration.
This file imports the default VitePress theme along with two CSS files: a custom stylesheet and the project’s main style file. Please verify that the order of imports (with custom.css imported before style.css) correctly implements your intended CSS layering and overrides for Tailwind CSS v4.

src/components/FwbModal/FwbModal.vue (1)

16-16: Confirm Consistency of Shadow Class Update.
The shadow class on the modal content has been updated from shadow to shadow-sm to provide a subtler effect. Please ensure that this visual adjustment is consistent with the design guidelines and overall UI update under Tailwind CSS v4.

docs/.vitepress/theme/custom.css (1)

9-9: Verify the Usage of the @source Rule.
The directive @source '../../../'; on line 9 is non-standard in typical CSS. Confirm whether this custom at-rule is supported by your build tools or if it was intended to be replaced with a standard CSS directive.

package.json (1)

51-70: Numerous dependency updates unrelated to Tailwind

While upgrading Tailwind is the primary goal, this PR includes updates to many dependencies unrelated to Tailwind (like ESLint, TypeScript, Vitest, etc). Consider splitting these into a separate dependency update PR to maintain focus.

Also applies to: 74-81

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b23c6e7 and 8813901.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • docs/.postcssrc.js (1 hunks)
  • docs/.vitepress/theme/custom.css (1 hunks)
  • docs/.vitepress/theme/index.js (1 hunks)
  • docs/.vitepress/theme/index.ts (0 hunks)
  • docs/.vitepress/theme/tailwind.css (0 hunks)
  • docs/vite.config.ts (1 hunks)
  • eslint.config.js (0 hunks)
  • package.json (1 hunks)
  • src/components/FwbButtonGroup/FwbButtonGroup.vue (1 hunks)
  • src/components/FwbDropdown/composables/useDropdownClasses.ts (1 hunks)
  • src/components/FwbFooter/FwbFooter.vue (1 hunks)
  • src/components/FwbModal/FwbModal.vue (1 hunks)
  • src/components/FwbToast/composables/useToastClasses.ts (1 hunks)
  • src/style.css (1 hunks)
  • tailwind.config.js (0 hunks)
  • vite.config.ts (1 hunks)
💤 Files with no reviewable changes (4)
  • docs/.vitepress/theme/tailwind.css
  • tailwind.config.js
  • docs/.vitepress/theme/index.ts
  • eslint.config.js
🧰 Additional context used
🪛 Biome (1.9.4)
docs/.vitepress/theme/custom.css

[error] 6-6: expected , but instead found (

Remove (

(parse)


[error] 6-6: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 6-6: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)


[error] 7-7: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 11-11: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

🔇 Additional comments (11)
src/components/FwbToast/composables/useToastClasses.ts (1)

31-31: Toast Shadow Class Enhancement.
The default wrapper for toast components now uses shadow-sm, aligning it with other updated components for a lighter, more refined shadow. This change helps improve visual consistency.

docs/.vitepress/theme/custom.css (1)

11-11:

❓ Verification inconclusive

Recheck Placement of the @import for './clear.css'.
The @import './clear.css'; directive on line 11 is also flagged for potential misplacement. Please ensure that all @import directives are located at the top of the stylesheet (aside from allowed exceptions), so that they are processed correctly.


Action: Verify @import Directive Placement in custom.css

Please double-check that the @import './clear.css'; directive on line 11 is positioned correctly. According to CSS best practices, all @import rules (aside from an optional @charset rule) should appear at the very top of the stylesheet. Verify that there are no other CSS rules (beyond permissible comments or whitespace) preceding this line that could affect stylesheet processing.

🧰 Tools
🪛 Biome (1.9.4)

[error] 11-11: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

docs/.postcssrc.js (1)

8-8:

✅ Verification successful

Updated Tailwind CSS PostCSS integration for Tailwind v4

The change from 'tailwindcss': {} to '@tailwindcss/postcss': {} reflects the new package naming convention for Tailwind CSS v4's PostCSS integration. This is a necessary update as part of the migration to Tailwind v4.


🌐 Web query:

What is the correct PostCSS plugin for Tailwind CSS v4?

💡 Result:

The error occurs because Tailwind CSS v4 requires using the separate @tailwindcss/postcss plugin instead of the main tailwindcss package for PostCSS integration. Here's how to fix it:

Required Steps

  1. Install dependencies:
npm install tailwindcss@latest @tailwindcss/postcss@latest
  1. Update PostCSS configuration (postcss.config.js):
module.exports = {
  plugins: {
    '@tailwindcss/postcss': {}
  }
}
  1. Remove deprecated plugins from your PostCSS config:
  • Delete postcss-import and autoprefixer (now handled internally by Tailwind v4)
  1. Import Tailwind in your main CSS file:
@import "tailwindcss";

Key Changes in v4

Aspect v3 Configuration v4 Configuration
PostCSS Plugin tailwindcss: {} @tailwindcss/postcss: {} [5]
Required Packages tailwindcss tailwindcss + @tailwindcss/postcss [7]
CSS Imports @tailwind directives @import "tailwindcss" [5]
Vendor Prefixing Required autoprefixer Built-in (no plugin needed) [5]

Common Pitfalls

  • Using outdated PostCSS plugin name (tailwindcss instead of @tailwindcss/postcss)
  • Forgetting to remove autoprefixer from PostCSS config [5][9]
  • Multiple CSS files needing individual @import statements [10]

For projects using Vite, consider switching to the official @tailwindcss/vite plugin instead of PostCSS for better performance [7].

Citations:


Tailwind CSS v4 PostCSS Integration Correctly Updated

Your configuration in docs/.postcssrc.js now correctly uses the @tailwindcss/postcss plugin instead of the outdated tailwindcss entry. This change complies with Tailwind CSS v4’s updated integration requirements as outlined in the official upgrade guide. Please ensure that any deprecated plugins (like autoprefixer) are also removed if no longer needed.

src/components/FwbDropdown/composables/useDropdownClasses.ts (1)

9-9: Updated shadow utility to match Tailwind v4 design system

Changed shadow to shadow-sm for the dropdown content wrapper, which aligns with Tailwind v4's updated shadow utility classes. This change maintains visual consistency with other component updates in this PR.

src/components/FwbFooter/FwbFooter.vue (1)

34-35: Updated shadow utilities to match Tailwind v4 design system

Changed shadow to shadow-sm for both the logo and default footer types, consistent with the shadow updates in other components. This ensures visual consistency across the application after upgrading to Tailwind v4.

docs/vite.config.ts (1)

3-3:

✅ Verification successful

Added Tailwind CSS Vite plugin integration for v4

Added the Tailwind CSS Vite plugin import and configuration, which is required for integrating Tailwind CSS v4 with Vite. This complements the PostCSS configuration changes and ensures proper processing of Tailwind utilities in the documentation build.

Also applies to: 8-10


🌐 Web query:

What is the correct Vite plugin for Tailwind CSS v4?

💡 Result:

The correct Vite plugin for Tailwind CSS v4 is @tailwindcss/vite, which replaces the previous PostCSS-based approach. Here's how to implement it:

Installation & Configuration

  1. Install dependencies:

    npm install -D tailwindcss @tailwindcss/vite

    This installs both Tailwind CSS v4 and its official Vite plugin[1][3][6].

  2. Update Vite config:

    // vite.config.js
    import { defineConfig } from 'vite'
    import tailwindcss from '@tailwindcss/vite'
    
    export default defineConfig({
      plugins: [
        tailwindcss()
      ]
    })

    This replaces previous PostCSS configurations[1][3][6].

  3. Modify CSS entry file:

    @import 'tailwindcss';

    Replace previous @tailwind directives with this single import[2][3][6].

Key Benefits

  • No PostCSS required: Removes need for postcss.config.js and associated dependencies[1][2][5]
  • Faster builds: Leverages Vite's module graph for optimized performance[3][5]
  • Simplified workflow: Automatic template detection and CSS processing[3][6]

Migration Notes

  1. Remove these from your project:
    npm uninstall postcss autoprefixer
  2. Delete any existing postcss.config.js files[2][4]
  3. Update VS Code's Tailwind IntelliSense extension to pre-release version for v4 support[2][4]

The official Tailwind CSS documentation confirms this as the recommended approach for Vite integration, particularly noting significant performance improvements over the PostCSS method[3][6]. While still compatible with PostCSS, the Vite plugin implementation is now preferred for new projects[5][9].

Citations:


Tailwind CSS Vite Plugin Integration Verified

The Tailwind CSS integration in docs/vite.config.ts—specifically importing @tailwindcss/vite (lines 3 and 8-10)—is correct for Tailwind CSS v4. This implementation replaces the former PostCSS setup and follows the official approach.

src/components/FwbButtonGroup/FwbButtonGroup.vue (2)

3-3: Shadow utility updated for Tailwind v4 compatibility

The change from shadow-sm to shadow-xs aligns with Tailwind v4's updated shadow utility classes.


11-12:

✅ Verification successful

New CSS reference directive added

The @reference directive is a Tailwind v4 feature that references styles without duplicating them, which is more efficient than @import.


🌐 Web query:

What is the @reference directive in Tailwind CSS v4?

💡 Result:

The @reference directive in Tailwind CSS v4.0 allows you to import stylesheets to access theme variables, custom utilities, and variants without duplicating CSS in your output. It's primarily used in component-scoped CSS (e.g., Vue/Svelte components, CSS modules) where Tailwind's configuration isn't automatically available.

Key Features of @reference

1. Access to Tailwind Context
Enables @apply, @variant, and theme variables in scoped CSS by referencing your main Tailwind stylesheet:

@reference "../../app.css";
.btn {
  @apply text-white bg-blue-500; /* Works after reference */
}

2. Zero Output Duplication
Unlike regular @import, @reference doesn't add the imported CSS to your output bundle[4][7].

3. Framework Component Support
Essential for styling components in:

  • Vue/Svelte <style> blocks
  • CSS Modules
  • Astro components[4][10]

Example Usage

<!-- Vue component -->
<style>
@reference "../../app.css"; 
.custom-card {
  @apply p-6 bg-background shadow-lg;
  color: var(--text-primary);
}
</style>

When to Use It

Scenario Solution
Using @apply in CSS Modules Required
Accessing theme variables in JS frameworks Required
Standard global CSS files Not needed

The directive addresses a key v4.0 limitation where component-scoped CSS loses access to Tailwind's context by default[7][9]. For optimal performance, consider using native CSS variables directly instead of @apply where possible.

Citations:


Approved: New Tailwind CSS @reference Directive Implementation

The new usage of the @reference directive in src/components/FwbButtonGroup/FwbButtonGroup.vue (lines 11–12) correctly leverages Tailwind CSS v4.0. It enables access to theme variables and utilities without duplicating CSS output, which is the intended purpose over using @import. No issues were noted with the implementation.

vite.config.ts (1)

3-3: Tailwind v4 Vite plugin properly integrated

The addition of @tailwindcss/vite plugin is required for Tailwind v4 compatibility with Vite. The plugin is correctly imported and added to the plugins array in the appropriate order.

Also applies to: 9-12

package.json (2)

46-46: Tailwind v4 dependencies correctly updated

The peerDependency update to Tailwind v4 and the addition of the required Tailwind v4 plugins (@tailwindcss/postcss and @tailwindcss/vite) are appropriate for this upgrade.

Also applies to: 72-73, 82-82


46-46: Tailwind listed as both dependency and peerDependency

Tailwind CSS is listed as both a direct dependency (line 82) and a peerDependency (line 46). This is unusual and could cause version conflicts in consuming applications.

Consider keeping Tailwind CSS only as a peerDependency to allow consuming applications to manage their own Tailwind version, which is the typical pattern for UI framework libraries.

Also applies to: 82-82

Comment on lines +6 to +7
@import 'tailwindcss/theme.css' layer(theme) source(none);
@import 'tailwindcss/utilities.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Revisit the Positioning of @import Statements.
The static analysis hints indicate that both @import rules on lines 6–7 should be placed before other at-rules (apart from permissible ones like @charset and @layer). Consider moving these imports so they precede the custom at-rule declarations (e.g., the @custom-variant) to adhere to CSS spec requirements.


Action Required: Reorder @import Rules for CSS Spec Compliance
Based on the CSS specification and static analysis hints, please move the following imports from lines 6–7 in docs/.vitepress/theme/custom.css so that they appear before any non-permissible at-rules (for example, before any custom declarations like @custom-variant). Ensuring that all @import statements (aside from allowed ones like @charset or @layer) are declared at the top will help avoid CSS parsing issues.

@import 'tailwindcss/theme.css' layer(theme) source(none);
@import 'tailwindcss/utilities.css';

Please adjust their position accordingly and verify that the overall styling behaves as expected.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: expected , but instead found (

Remove (

(parse)


[error] 6-6: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 6-6: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)


[error] 7-7: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


@custom-variant dark (&:where(.dark, .dark *));

@import 'tailwindcss/theme.css' layer(theme) source(none);
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Fix Syntax of @import Rule on Line 6.
Static analysis reports a syntax error in the statement:

@import 'tailwindcss/theme.css' layer(theme) source(none);

It appears that the parser expected a comma before the parenthesis. Please review the intended syntax—if this is an experimental feature or a Tailwind v4 update, confirm that the syntax is correct or adjust it to match the latest Tailwind and CSS specifications.


Action Required: Correct the @import Syntax on Line 6 of docs/.vitepress/theme/custom.css

The static analysis indicates that the current statement:

@import 'tailwindcss/theme.css' layer(theme) source(none);

is causing a syntax error—the parser appears to expect a comma to separate the descriptors. To align with the parser’s expectations (and assuming no alternative experimental behavior is intended), please update the code as follows:

@import 'tailwindcss/theme.css' layer(theme), source(none);

Ensure that this change is consistent with the latest Tailwind v4 (or experimental CSS features) specifications. If this syntax is intended to be experimental, double-check that your compiler or build tool fully supports it.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: expected , but instead found (

Remove (

(parse)


[error] 6-6: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 6-6: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)

Copy link
Contributor

@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: 1

🔭 Outside diff range comments (1)
docs/.vitepress/theme/custom.css (1)

1-12: 🛠️ Refactor suggestion

CSS Import Ordering & Syntax Corrections Needed
Static analysis has flagged several issues:

  • Syntax Error and Invalid Positioning: The @import rules on lines 6, 7, and 11 are reported to be in the wrong position and use syntax which the parser does not expect (e.g., the parentheses in layer(theme) source(none)).
  • Ordering Requirement: According to CSS standards, all @import rules must precede all other style rules (aside from @charset and @layer declarations).

A recommended refactor is to move all @import rules to the top of the file and then encapsulate the custom variant and source directives within the appropriate @layer block. For instance:

-/* .vitepress/theme/custom.css */
-@layer theme, base, components, utilities;
-@custom-variant dark (&:where(.dark, .dark *));
-@import 'tailwindcss/theme.css' layer(theme) source(none);
-@import 'tailwindcss/utilities.css';
-@source '../../../';
-@import './clear.css';
+/* .vitepress/theme/custom.css */
+@import 'tailwindcss/theme.css' layer(theme) source(none);
+@import 'tailwindcss/utilities.css';
+@import './clear.css';
+
+@layer theme, base, components, utilities {
+  @custom-variant dark (&:where(.dark, .dark *));
+  @source '../../../';
+}

This change should resolve the static analysis warnings by ensuring the proper ordering and syntax.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: expected , but instead found (

Remove (

(parse)


[error] 6-6: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 6-6: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)


[error] 7-7: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 11-11: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b23c6e7 and 8813901.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • docs/.postcssrc.js (1 hunks)
  • docs/.vitepress/theme/custom.css (1 hunks)
  • docs/.vitepress/theme/index.js (1 hunks)
  • docs/.vitepress/theme/index.ts (0 hunks)
  • docs/.vitepress/theme/tailwind.css (0 hunks)
  • docs/vite.config.ts (1 hunks)
  • eslint.config.js (0 hunks)
  • package.json (1 hunks)
  • src/components/FwbButtonGroup/FwbButtonGroup.vue (1 hunks)
  • src/components/FwbDropdown/composables/useDropdownClasses.ts (1 hunks)
  • src/components/FwbFooter/FwbFooter.vue (1 hunks)
  • src/components/FwbModal/FwbModal.vue (1 hunks)
  • src/components/FwbToast/composables/useToastClasses.ts (1 hunks)
  • src/style.css (1 hunks)
  • tailwind.config.js (0 hunks)
  • vite.config.ts (1 hunks)
💤 Files with no reviewable changes (4)
  • docs/.vitepress/theme/tailwind.css
  • tailwind.config.js
  • docs/.vitepress/theme/index.ts
  • eslint.config.js
🧰 Additional context used
🪛 Biome (1.9.4)
docs/.vitepress/theme/custom.css

[error] 6-6: expected , but instead found (

Remove (

(parse)


[error] 6-6: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 6-6: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)


[error] 7-7: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)


[error] 11-11: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

🔇 Additional comments (15)
src/style.css (1)

1-1: Tailwind CSS Import Added
The import statement for Tailwind CSS is correctly added to enable the use of Tailwind’s utility classes throughout your stylesheet.

src/components/FwbModal/FwbModal.vue (1)

16-16: Consistent Shadow Class Update
Replacing the generic shadow class with shadow-sm aligns with the updated design guidelines and ensures uniformity in shadow effects across components.

docs/.vitepress/theme/index.js (1)

1-5: Well-Structured Theme Imports
This file correctly imports the default VitePress theme along with the custom CSS and the main style file. The ordering ensures that the customizations in custom.css and styles in style.css are applied properly.

src/components/FwbToast/composables/useToastClasses.ts (1)

31-31: Unified Shadow Styling in Toast Component
Updating the default wrapper classes to include shadow-sm maintains consistency with similar updates across other components. This change enhances the visual design coherence.

docs/.postcssrc.js (1)

8-8: Updated PostCSS plugin for Tailwind CSS v4

The configuration has been correctly updated to use @tailwindcss/postcss which is the appropriate PostCSS plugin for Tailwind CSS v4. This change is essential for the Tailwind v4 upgrade to work properly.

src/components/FwbButtonGroup/FwbButtonGroup.vue (2)

3-3: Shadow utility updated to align with Tailwind v4

The shadow class has been updated from shadow-sm to shadow-xs, which aligns with Tailwind v4's shadow utilities. This change ensures consistent shadow styling across the application.


11-12: Added CSS reference directive

The @reference directive is used to reference external stylesheets without embedding them. This is a proper approach for modular CSS in the Tailwind v4 ecosystem.

src/components/FwbDropdown/composables/useDropdownClasses.ts (1)

9-9: Updated shadow utility class

Changed from shadow to shadow-sm in the dropdown's default content wrapper classes. This ensures consistent shadow styling in accordance with the Tailwind v4 upgrade across all components.

vite.config.ts (2)

3-3: Added Tailwind CSS Vite plugin import

Correctly imported the Tailwind CSS Vite plugin from @tailwindcss/vite, which is necessary for integrating Tailwind v4 with the Vite build system.


9-12: Configured Tailwind CSS Vite plugin

The plugins array has been properly updated to include both the Vue plugin and the Tailwind CSS plugin. This configuration ensures that Tailwind directives are processed correctly during the build process.

docs/vite.config.ts (1)

3-3: LGTM: Proper Tailwind v4 Vite plugin integration

The addition of tailwindcss from @tailwindcss/vite and its setup in the plugins array correctly integrates Tailwind v4 with the Vite build process for the documentation site.

Also applies to: 8-10

src/components/FwbFooter/FwbFooter.vue (1)

34-35: Shadow class updates for Tailwind v4 compatibility

The changes from shadow to shadow-sm in the footer component properly align with Tailwind v4's shadow utility classes, providing a more subtle shadow effect.

package.json (3)

46-46: Tailwind peer dependency updated to v4

The peer dependency has been correctly updated to require Tailwind v4, which is essential for the library's consumers to use the right version.


72-74: Added required Tailwind v4 integration packages

The new Tailwind v4 specific packages for PostCSS and Vite integration have been properly added, which are necessary for the new plugin architecture in Tailwind v4.


51-69: Dev dependencies updated

All development dependencies have been updated to their latest compatible versions, which is good practice when performing a major framework upgrade.

Comment on lines +77 to +82
"flowbite": "3.1.2",
"lodash-es": "^4.17.21",
"nanoid": "5.0.9",
"tailwind-merge": "2.6.0",
"tailwindcss": "^3"
"nanoid": "5.1.3",
"postcss-prefix-selector": "^2.1.0",
"tailwind-merge": "3.0.2",
"tailwindcss": "^4"
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Dependency versions updated for Tailwind v4 compatibility

All related dependencies have been updated to versions compatible with Tailwind v4. Note that tailwindcss appears in both peerDependencies and dependencies, which is unusual but can be beneficial for development purposes.


🌐 Web query:

What are the best practices for listing tailwindcss in both peerDependencies and dependencies in package.json?

💡 Result:

When listing Tailwind CSS in package.json, the best practices depend on whether your package is a host-dependent library (like a plugin/component library) or a self-contained utility:

For host-dependent libraries (plugins/component libraries)

  1. Use peerDependencies
    List Tailwind CSS here if your package requires the host app to provide Tailwind configuration:

    "peerDependencies": {
      "tailwindcss": ">=3.0.0"
    }

    This ensures:

    • Single Tailwind instance in the final build[3][4]
    • Host app's theme/config gets inherited[3][10]
    • Avoids version conflicts between multiple installations[4][8]
  2. Keep version ranges wide
    Use caret (^) or greater-than ranges to maximize compatibility:

    "tailwindcss": "^3.0.0 || ^2.0.0"

For self-contained utilities

  1. Use dependencies
    List Tailwind CSS here if your package:
    • Bundles its own styles[2][5]
    • Doesn't require host app configuration[6]
    "dependencies": {
      "tailwindcss": "^3.3.3"
    }

Special cases to avoid

  1. Never list in both
    While technically possible, this creates installation conflicts in npm 6 and confuses package managers[8].

  2. Don't use devDependencies
    Unless you're publishing unbuilt source code (rare for CSS utilities).

Example scenarios

Package Type Dependencies PeerDependencies
Tailwind plugin tailwindcss
Component library tailwindcss
CLI tool with styles tailwindcss

Key considerations

  • Always specify tailwindcss in either dependencies or peerDependencies[4][6]
  • Warn users in documentation if Tailwind is required[3]
  • Use JIT mode when possible for smaller bundles[3][7]
  • Leverage CSS variables for theme integration[10]

For React component libraries, a common pattern is:

{
  "peerDependencies": {
    "tailwindcss": "^3.0.0",
    "react": "^18.0.0"
  },
  "devDependencies": {
    "tailwindcss": "^3.3.3"
  }
}

This allows development with specific Tailwind versions while letting users control the final installation[2][6].

Citations:


Tailwind CSS Dependency Declaration: Clarify Single Source of Truth
All dependency versions have been updated for Tailwind v4 compatibility. However, the package currently lists Tailwind CSS in both peerDependencies and dependencies. According to best practices, a package should declare Tailwind CSS in only one of these places to avoid installation conflicts (especially in npm 6) and to ensure a single, consistent instance in the final build. Consider the following based on your package type:

  • For host-dependent libraries (e.g., plugins or component libraries):
    • Remove Tailwind CSS from dependencies and list it solely in peerDependencies with a wide version range (e.g., "tailwindcss": ">=3.0.0") so that the host application supplies its configuration.

  • For self-contained applications or utilities:
    • Keep Tailwind CSS in dependencies (or consider moving the version used solely for development to devDependencies), ensuring that your package bundles its own styles.

Please review and adjust the dependency declaration as appropriate for the intended use of your package.

Copy link
Contributor

@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: 0

🧹 Nitpick comments (9)
docs/pages/getting-started.md (9)

1-3: Clear Component Import.
The <script setup> block correctly imports FwbAlert from flowbite-vue. Please verify that this import—appearing again later in the file—is intentionally duplicated (for demonstrating both global usage and a self-contained example) rather than being redundant.


11-11: HTML Line Break Tag Usage.
The <br> tag is used to force a line break. Consider whether standard markdown line breaks (e.g. ending a line with two spaces) might suffice in this context unless HTML is specifically preferred for consistent formatting.


31-43: Vite Plugin Configuration Update.
The configuration snippet effectively integrates the new Tailwind CSS Vite plugin using @tailwindcss/vite. For future maintainability, consider adding inline comments inside the configuration (e.g. explaining the purpose or order of each plugin).


47-50: Tailwind CSS Import Statement.
The import statement @import "tailwindcss"; is used here. Please verify that this approach is compatible with Tailwind CSS v4—current best practices may favor using directives such as @tailwind base;, @tailwind components;, and @tailwind utilities;.


52-54: @reference Directive Notice.
The info box instructing users to @reference their main style in <style> blocks is helpful. Since @reference is not a standard CSS directive, please ensure that it is properly supported and documented in the context of Tailwind CSS v4 and your PostCSS setup.


66-84: Flowbite Vue Configuration Update.
The updated instructions for installing Flowbite and Flowbite Vue—including the use of @import, @plugin, and @source directives in style.css—are clear. Consider adding brief inline comments to explain the purpose of the less-common directives (@plugin and @source) for users who might be unfamiliar with them.


86-86: Refine Descriptive Language.
The phrase "build awesome interfaces" is somewhat informal. For a more professional tone, consider replacing "awesome" with a term like "robust" or "responsive."

🧰 Tools
🪛 LanguageTool

[style] ~86-~86: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...ue** anywhere in your project and build awesome interfaces:

<fw...

(AWESOME)


94-104: Self-Contained Vue Component Example.
This Vue snippet provides a clear, self-contained example of using the FwbAlert component. Note that it re-imports FwbAlert even though a similar import appears at the top of the document; if the component is registered globally in your project, you might consider removing this local import to reduce redundancy.


20-20: Heading Level Consistency.
The heading "### Install and configure TailwindCSS" appears immediately after an h1 title, which skips a level. For better document structure and accessibility, consider changing it to an h2 (i.e. use ##) so that heading levels increment sequentially.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8813901 and dc8670d.

📒 Files selected for processing (2)
  • docs/pages/getting-started.md (1 hunks)
  • package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
🪛 LanguageTool
docs/pages/getting-started.md

[uncategorized] ~9-~9: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...of the utility-classes from Tailwind CSS and it also includes a JavaScript file that...

(COMMA_COMPOUND_SENTENCE)


[style] ~86-~86: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...ue** anywhere in your project and build awesome interfaces:

<fw...

(AWESOME)

🪛 markdownlint-cli2 (0.17.2)
docs/pages/getting-started.md

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🔇 Additional comments (4)
docs/pages/getting-started.md (4)

13-18: Informational Block Clarity.
The info box advising users to ensure Node.js (v18+) is installed is clear and instructive. This addition helps set the correct environment expectations for Flowbite Vue.


25-25: Tailwind CSS Installation Command.
The command npm install -D tailwindcss @tailwindcss/vite correctly reflects the updated dependency installation for Tailwind CSS.


56-64: Vue Style Block Example.
This snippet demonstrates referencing the main stylesheet with @reference "./style.css"; and using Tailwind’s @apply to compose styles. Confirm that the @reference directive is officially supported by your Tailwind CSS v4 configuration or any custom PostCSS plugins you are using.


88-93: Clear Example Usage.
The HTML block effectively demonstrates how to use the <fwb-alert> component. The example message is clear and engaging.

@Sqrcz Sqrcz merged commit 93165ed into themesberg:main Mar 19, 2025
14 checks passed
Copy link
Contributor

@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: 1

🧹 Nitpick comments (5)
docs/pages/getting-started.md (5)

9-9: Punctuation Suggestion in Introductory Text

Consider adding a comma before “and” to improve the readability of the sentence on line 9. For example:
"Flowbite is a library of components built on top of the utility-classes from Tailwind CSS, and it also includes a JavaScript file..."

🧰 Tools
🪛 LanguageTool

[uncategorized] ~9-~9: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...of the utility-classes from Tailwind CSS and it also includes a JavaScript file that...

(COMMA_COMPOUND_SENTENCE)


11-11: Evaluate Use of HTML <br>

Using an explicit <br> tag (line 11) for spacing in Markdown may be unnecessary. Consider relying on Markdown’s native formatting (such as blank lines) unless a specific line break is desired.


20-20: Adjust Heading Level for Consistent Hierarchy

The heading "### Install and configure TailwindCSS" (line 20) skips from an # heading to an ### heading. For a smoother hierarchy, consider changing it to a level 2 heading (## Install and configure TailwindCSS).

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)


86-86: Refine Informal Language in Heading

The phrase “build awesome interfaces” (line 86) might be too informal for documentation. Consider using a more formal alternative (e.g., “build exceptional interfaces”) to match the overall tone of the guide.

🧰 Tools
🪛 LanguageTool

[style] ~86-~86: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...ue** anywhere in your project and build awesome interfaces:

<fw...

(AWESOME)


101-103: Ensure Consistency in Example Code Imports

The example code snippet at the bottom (lines 101–103) correctly imports FwbAlert from flowbite-vue, which further highlights the inconsistency with the top <script setup> block. Please align both usages to avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc8670d and 01809f5.

📒 Files selected for processing (1)
  • docs/pages/getting-started.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/pages/getting-started.md

[uncategorized] ~9-~9: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...of the utility-classes from Tailwind CSS and it also includes a JavaScript file that...

(COMMA_COMPOUND_SENTENCE)


[style] ~86-~86: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...ue** anywhere in your project and build awesome interfaces:

<fw...

(AWESOME)

🪛 markdownlint-cli2 (0.17.2)
docs/pages/getting-started.md

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

Comment on lines +1 to +3
<script setup>
import { FwbAlert } from '../../src/index'
</script>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Inconsistent Import Source for FwbAlert

The <script setup> block currently imports FwbAlert from ../../src/index, whereas the later example (lines 101–103) imports it from flowbite-vue. For consistency and clarity in documentation, please update this import to use flowbite-vue.

- import { FwbAlert } from '../../src/index'
+ import { FwbAlert } from 'flowbite-vue'
📝 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
<script setup>
import { FwbAlert } from '../../src/index'
</script>
<script setup>
import { FwbAlert } from 'flowbite-vue'
</script>

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

Labels

🔧 enhancement New feature or request 🤖 maintenance dependency updates, releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant