Skip to content

fix: add @tailwindcss/vite and update dependencies - #199

Open
shazzar00ni wants to merge 6 commits into
mainfrom
feature/security-dependency-updates
Open

fix: add @tailwindcss/vite and update dependencies#199
shazzar00ni wants to merge 6 commits into
mainfrom
feature/security-dependency-updates

Conversation

@shazzar00ni

Copy link
Copy Markdown
Owner

Summary

  • Add @tailwindcss/vite plugin for Tailwind v4 support
  • Update ESLint, TypeScript, Vite, and other major dependencies
  • Add engines.node constraint
  • Remove legacy .eslintrc.cjs

- Add @tailwindcss/vite plugin to vite.config.ts
- Update to ESLint 10 and @eslint/js for compatibility
- Update TypeScript, Vite, and other major dependencies
- Add engines.node field for Node version requirement
- Remove legacy .eslintrc.cjs config
Copilot AI review requested due to automatic review settings May 6, 2026 02:41

@infinitcode-ai infinitcode-ai Bot 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.

Summary

The pull request migrates from Tailwind CSS v3 directives to v4's new @import and @theme syntax, and adds the @tailwindcss/vite plugin. The changes are largely correct and align with Tailwind v4 conventions, though the removal of @layer base and @apply may affect existing styles if not handled elsewhere. Overall, the migration appears safe and improves maintainability.

Review Verdict: ✅ Review Passed
The code is largely correct and follows Tailwind v4 best practices. No critical issues detected.

Changes

File Path Changes Detected
src/index.css • Replaced @tailwind base, @tailwind components, @tailwind utilities with @import "tailwindcss" as per Tailwind v4.
• Added @theme block to define custom color tokens using OKLCH color space.
• Moved scroll-behavior: smooth from @layer base to direct html selector.
• Replaced @apply directives in body with explicit CSS custom properties and transitions.
• Updated dark mode selector from .dark body to :is(.dark) body.
• Converted @layer utilities classes to @utility directives for text-balance and gradient-text.
vite.config.ts • Added @tailwindcss/vite plugin to the Vite plugins array for Tailwind v4 integration.

Code Style & Consistency

All identifiers follow project casing conventions.

Hot Take

"This PR is like swapping out a perfectly good toolbox for a shiny new one, but forgetting to check if the screws still fit. You've replaced @apply with CSS variables, which is great, but now your gradient-text utility is just a fancy way of saying 'I miss Tailwind v3'."

Example Commands:

@infinitcodeai review          Trigger an instant AI PR review.
@infinitcodeai {prompt}        Ask anything about your codebase.

Note: For additional settings, navigate to Infinitcode AI.

About

Automated review powered by Infinitcode AI
Report generated at 5/6/2026, 2:42:05 AM

@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docugen Error Error May 6, 2026 5:16pm

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@shazzar00ni has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3b2bcf5d-ad21-47fe-89e0-ead78811772f

📥 Commits

Reviewing files that changed from the base of the PR and between a82a1da and 3b4795e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/index.css

Walkthrough

The PR modernizes the development environment by upgrading package.json dependencies (including ESLint, Playwright, Tailwind, and Vitest tooling), adds Node engine constraints, refactors src/index.css from Tailwind @layer directives to a theme-driven CSS variable system, and integrates Tailwind CSS into the Vite build config.

Changes

Development Tooling and Styling Modernization

Layer / File(s) Summary
Dependency Updates & Node Constraint
package.json
Expanded devDependencies with ESLint ecosystem, Playwright, Tailwind, testing libraries, Vite, and TypeScript tooling; versions updated (e.g., @types/react 19.2.14, vite 8.0.10, typescript 6.x); engines enforced to Node >=20.19.0.
Build Config Integration
vite.config.ts
Tailwind CSS Vite plugin imported and added to plugins array alongside React plugin.
Styling Refactor
src/index.css
Replaced Tailwind @layer base/utilities with theme-driven @theme block defining CSS variables; HTML and body styling converted from @apply directives to explicit CSS properties using var(); dark-mode support added via :is(.dark) selector; new @utility blocks for text-balance and gradient-text using CSS variables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • shazzar00ni/docugen#68: Modifies the same frontend build/config files (package.json, src/index.css) and alters Tailwind/Vite integration patterns.

Suggested labels

dependencies

Poem

🎨 Variables dance where Tailwind once commanded,
A theme-swept rebrand, cleanly hand-landed.
Vite and Node joined the modern choir,
Styling CSS, ambition climbing higher. 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main changes: adding @tailwindcss/vite and updating dependencies, matching the primary objectives of the PR.
Description check ✅ Passed The description is directly related to the changeset, providing a bulleted summary of the key changes including Tailwind v4 support, dependency updates, and configuration removal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/security-dependency-updates

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.

@codacy-production

codacy-production Bot commented May 6, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot added the dependencies Pull requests that update a dependency file label May 6, 2026
@socket-security

socket-security Bot commented May 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​eslint/​js@​10.0.110010010090100

View full report

Comment thread src/index.css
html {
scroll-behavior: smooth;
}
@theme {
Comment thread src/index.css
.gradient-text {
@apply bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-teal-600;
}
@utility text-balance {
Comment thread src/index.css
text-wrap: balance;
}

@utility gradient-text {
Comment thread src/index.css
background-clip: text;
color: transparent;
background-image: linear-gradient(to right, var(--color-teal-400), var(--color-teal-600));
} No newline at end of file
Comment thread src/index.css
html {
scroll-behavior: smooth;
}
@theme {
Comment thread src/index.css
.text-balance {
text-wrap: balance;
}
:is(.dark) body {
Comment thread src/index.css
.gradient-text {
@apply bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-teal-600;
}
@utility text-balance {
Comment thread src/index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
Comment thread src/index.css
@apply bg-dark-950 text-dark-100;
}
body {
background-color: var(--color-light-50);
Comment thread src/index.css
}
body {
background-color: var(--color-light-50);
color: var(--color-light-900);

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the frontend build/tooling setup to support Tailwind CSS v4 (via the @tailwindcss/vite plugin) and refreshes major dev dependencies, while also introducing a Node engine constraint.

Changes:

  • Add @tailwindcss/vite to the Vite plugin chain for Tailwind v4 support.
  • Migrate src/index.css from Tailwind v3-style directives (@tailwind, @layer, @apply) to Tailwind v4 CSS-first constructs (@import, @theme, @utility) and explicit CSS variables.
  • Update major dev dependencies and add a package.json engines.node constraint.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
vite.config.ts Adds the Tailwind v4 Vite plugin to the build pipeline.
src/index.css Migrates Tailwind usage to v4 CSS-first approach and introduces theme tokens/utilities.
package.json Updates key tooling dependencies and adds a Node engines constraint.
package-lock.json Partially updated, but currently not aligned with package.json dependency changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.css
Comment thread src/index.css
Comment on lines +3 to +10
@theme {
--color-light-50: oklch(97.95% 0.014 250.75);
--color-light-900: oklch(20.49% 0.038 264.38);
--color-dark-950: oklch(7.37% 0.019 285.85);
--color-dark-100: oklch(90.45% 0.02 285.85);
--color-teal-400: oklch(78.86% 0.162 174.21);
--color-teal-600: oklch(49.62% 0.104 181.28);
}
Comment thread package.json Outdated
"vitest": "^4.1.5"
},
"engines": {
"node": ">=20.19.0"
Comment thread package.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 55-56: The package.json engines entry is too permissive ("node":
">=20.19.0") and allows Node 21 and 23 which are incompatible with Vite 8/ESLint
10; update the "engines" -> "node" value to a tightened semver range that
permits Node 20 (>=20.19.0), Node 22 starting at 22.13.0, and Node 24+, e.g.
">=20.19.0 <21 || >=22.13.0 <23 || >=24", by editing the engines.node string in
package.json.

In `@src/index.css`:
- Around line 3-35: The CSS uses Tailwind v4 at-rules `@theme` and `@utility` which
the linters currently treat as unknown; update biome.json by enabling Tailwind
directive parsing (set css.parser.tailwindDirectives to true) so the CSS parser
accepts `@theme/`@utility, and update .stylelintrc.json to allow those at-rules
(e.g., configure the at-rule-no-unknown rule with ignoreAtRules:
["theme","utility"] or add them to an ignoreAtRules list) so Stylelint no longer
flags `@theme` and `@utility` as unknown.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b13ab7a7-3fbd-4ac5-9754-0ccbf34d29bb

📥 Commits

Reviewing files that changed from the base of the PR and between dcff020 and a82a1da.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/index.css
  • vite.config.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Agent
  • GitHub Check: Codacy Static Code Analysis
🧰 Additional context used
🪛 Biome (2.4.14)
src/index.css

[error] 3-10: Tailwind-specific syntax is disabled.

(parse)


[error] 27-29: Tailwind-specific syntax is disabled.

(parse)


[error] 31-35: Tailwind-specific syntax is disabled.

(parse)

🪛 Stylelint (17.10.0)
src/index.css

[error] 3-3: Unexpected unknown at-rule "@theme" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)


[error] 27-27: Unexpected unknown at-rule "@Utility" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)


[error] 31-31: Unexpected unknown at-rule "@Utility" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)

Comment thread package.json Outdated
Comment thread src/index.css
Comment on lines +3 to +35
@theme {
--color-light-50: oklch(97.95% 0.014 250.75);
--color-light-900: oklch(20.49% 0.038 264.38);
--color-dark-950: oklch(7.37% 0.019 285.85);
--color-dark-100: oklch(90.45% 0.02 285.85);
--color-teal-400: oklch(78.86% 0.162 174.21);
--color-teal-600: oklch(49.62% 0.104 181.28);
}

body {
@apply bg-light-50 text-light-900 transition-colors duration-300;
}
html {
scroll-behavior: smooth;
}

.dark body {
@apply bg-dark-950 text-dark-100;
}
body {
background-color: var(--color-light-50);
color: var(--color-light-900);
transition: color 300ms, background-color 300ms;
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
:is(.dark) body {
background-color: var(--color-dark-950);
color: var(--color-dark-100);
}

.gradient-text {
@apply bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-teal-600;
}
@utility text-balance {
text-wrap: balance;
}

@utility gradient-text {
background-clip: text;
color: transparent;
background-image: linear-gradient(to right, var(--color-teal-400), var(--color-teal-600));
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Config files =="
fd -HI 'biome.json|biome.jsonc|stylelint.config.*|.stylelintrc*|package.json'

echo
echo "== Relevant settings =="
fd -HI 'biome.json|biome.jsonc|stylelint.config.*|.stylelintrc*|package.json' -x sh -c '
  file="$1"
  echo "--- $file ---"
  rg -n -C2 "tailwindDirectives|ignoreAtRules|atRules|scss/at-rule-no-unknown|at-rule-no-unknown" "$file" || true
' sh {}

Repository: shazzar00ni/docugen

Length of output: 221


🏁 Script executed:

cat -n biome.json

Repository: shazzar00ni/docugen

Length of output: 4216


🏁 Script executed:

cat -n .stylelintrc.json

Repository: shazzar00ni/docugen

Length of output: 1689


🏁 Script executed:

head -50 src/index.css

Repository: shazzar00ni/docugen

Length of output: 871


Add Tailwind v4 directive support to CSS lint configurations.

The @theme and @utility directives are valid Tailwind v4 syntax, but both biome.json and .stylelintrc.json lack the necessary configuration to recognize them:

  • biome.json: The CSS parser config (lines 107–109) must enable Tailwind directive parsing by adding "tailwindDirectives": true to the css.parser object.
  • .stylelintrc.json: Stylelint must either ignore or explicitly allow the @theme and @utility at-rules. Add an at-rule-no-unknown rule configuration or ignoreAtRules list in the config to prevent unknown at-rule errors.

Without these changes, CSS linting will fail on the new directives during CI.

🧰 Tools
🪛 Biome (2.4.14)

[error] 3-10: Tailwind-specific syntax is disabled.

(parse)


[error] 27-29: Tailwind-specific syntax is disabled.

(parse)


[error] 31-35: Tailwind-specific syntax is disabled.

(parse)

🪛 Stylelint (17.10.0)

[error] 3-3: Unexpected unknown at-rule "@theme" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)


[error] 27-27: Unexpected unknown at-rule "@Utility" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)


[error] 31-31: Unexpected unknown at-rule "@Utility" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.css` around lines 3 - 35, The CSS uses Tailwind v4 at-rules `@theme`
and `@utility` which the linters currently treat as unknown; update biome.json by
enabling Tailwind directive parsing (set css.parser.tailwindDirectives to true)
so the CSS parser accepts `@theme/`@utility, and update .stylelintrc.json to allow
those at-rules (e.g., configure the at-rule-no-unknown rule with ignoreAtRules:
["theme","utility"] or add them to an ignoreAtRules list) so Stylelint no longer
flags `@theme` and `@utility` as unknown.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Comment thread package.json
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24.0.0"
},
},
@shazzar00ni shazzar00ni self-assigned this May 6, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

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

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants