Skip to content

Fix missing Tailwind CSS — configure v4 with PostCSS and theme tokens#4

Merged
BAWES merged 2 commits into
mainfrom
feature/STU-13-tailwind-setup
May 20, 2026
Merged

Fix missing Tailwind CSS — configure v4 with PostCSS and theme tokens#4
BAWES merged 2 commits into
mainfrom
feature/STU-13-tailwind-setup

Conversation

@BAWES
Copy link
Copy Markdown
Owner

@BAWES BAWES commented May 20, 2026

Summary

  • Installed tailwindcss, @tailwindcss/postcss, postcss, and autoprefixer as devDependencies
  • Created postcss.config.mjs with the Tailwind v4 PostCSS plugin
  • Added @import "tailwindcss" and a @theme block to src/app/styles.css, mapping 16 CSS custom properties to Tailwind design tokens

All 14 components using Tailwind utility classes (Skeleton, Sheet, Command, Select, Tabs, DropdownMenu, Dialog, Tooltip, Badge, Button, Card, Input, Separator) now resolve correctly.

Test plan

  • next build compiles with zero errors across all 34 routes
  • Dark theme CSS variables continue to work via existing [data-theme="dark"] overrides
  • No tailwind.config.ts needed — Tailwind v4 configures via CSS @theme blocks

Summary by CodeRabbit

Release Notes

  • New Features

    • Command palette now displays keyboard shortcuts for quick navigation across different sections.
  • Chores

    • Updated styling framework and development dependencies.

Review Change Stack

BAWES and others added 2 commits May 21, 2026 04:38
`buildOSCommands()` never set the `shortcut` property on command objects,
so the chord handler never matched G+H, G+C, G+R, G+T, G+O chords. Added
a chord-to-href map keyed by role and applied shortcuts to both nav and
scope commands.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add tailwindcss, @tailwindcss/postcss, postcss, and autoprefixer as
devDependencies. Create postcss.config.mjs with the Tailwind v4 PostCSS
plugin. Add @import "tailwindcss" and @theme block to styles.css mapping
existing CSS custom properties to Tailwind design tokens.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Walkthrough

Tailwind CSS build infrastructure is introduced via package dependencies, PostCSS configuration, and theme token integration in the global stylesheet. Separately, the OS command palette is enhanced with per-role keyboard shortcut hints assigned to navigation and scope commands.

Changes

Tailwind CSS and Command Palette Enhancements

Layer / File(s) Summary
Tailwind CSS and PostCSS setup
package.json, postcss.config.mjs, src/app/styles.css
Tailwind, PostCSS, autoprefixer, and @tailwindcss/postcss are added as dev dependencies. PostCSS config loads both plugins. Global stylesheet imports Tailwind and maps existing design token CSS variables (--background, --foreground, --card, --primary, --muted, --border, --radius, etc.) into Tailwind theme tokens via @theme directives.
Command palette keyboard shortcut hints
src/modules/workspace/WorkspaceOS.tsx
buildOSCommands now builds a role-based href→chord mapping and assigns a computed shortcut property to both navigation command items and quick-scope commands (Candidates, Requests, Companies, Transfers, Invitations, Work Logs), enabling keyboard shortcut discovery in the command palette.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the summary, key changes, and test plan, but is missing the required Type checkbox selection and most checklist items (TypeScript, build, validation, smoke tests, etc.). Complete the Type section by selecting 'Tooling/CI' or 'Design system/UI', and fill out the verification checklist (TypeScript passes, build passes, etc.) to confirm all checks are satisfied.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: installing and configuring Tailwind CSS v4 with PostCSS and theme tokens, matching the core objective.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/STU-13-tailwind-setup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/app/styles.css

Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): "decorators", "decorators-legacy". (1:0)


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

Copy link
Copy Markdown

@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

🤖 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 `@src/app/styles.css`:
- Around line 3-24: Stylelint flags the Tailwind v4 `@theme` at-rule in styles.css
(the `@theme` block defining --color-... variables) as unknown; update your
Stylelint config (.stylelintrc.json) to allow this at-rule by modifying the
at-rule-no-unknown rule to ignore "theme" (and keep "import" if already needed)
so the `@theme` block passes linting without disabling the rule globally.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fe9bc2f-7d17-4833-9cb0-8c10bd966a4f

📥 Commits

Reviewing files that changed from the base of the PR and between 4287c9a and 35bfcef.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • postcss.config.mjs
  • src/app/styles.css
  • src/modules/workspace/WorkspaceOS.tsx

Comment thread src/app/styles.css
Comment on lines +3 to +24
@theme {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted-shadcn);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--radius: var(--radius);
}
Copy link
Copy Markdown

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
# Verify stylelint config currently flags/ignores Tailwind at-rules.
fd -HI 'stylelint|\.stylelintrc' .
rg -n --hidden -S 'at-rule-no-unknown|scss/at-rule-no-unknown|ignoreAtRules|theme|tailwind' \
  .stylelintrc* stylelint.config.* **/.stylelintrc* **/stylelint.config.* 2>/dev/null

Repository: BAWES/studenthub-codex

Length of output: 86


🏁 Script executed:

cat .stylelintrc.json

Repository: BAWES/studenthub-codex

Length of output: 1426


🏁 Script executed:

# Check for other stylelint configs
git ls-files | grep -i stylelint

# Check for Tailwind config
git ls-files | grep -E '(tailwind|postcss)'

# Check the styles.css file to confirm `@theme` is present
head -n 25 src/app/styles.css

Repository: BAWES/studenthub-codex

Length of output: 974


🏁 Script executed:

cat postcss.config.mjs

Repository: BAWES/studenthub-codex

Length of output: 182


Configure Stylelint to allow Tailwind v4 @theme rule to prevent lint errors.

The @theme at-rule (line 3) is valid in Tailwind v4 but Stylelint's inherited at-rule-no-unknown rule does not recognize it. Add the following to .stylelintrc.json:

"rules": {
  "at-rule-no-unknown": [true, { "ignoreAtRules": ["theme", "import"] }]
}

This prevents CI/lint failures while maintaining CSS validation.

🧰 Tools
🪛 Stylelint (17.11.1)

[error] 3-3: Unexpected unknown at-rule "@theme" (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/app/styles.css` around lines 3 - 24, Stylelint flags the Tailwind v4
`@theme` at-rule in styles.css (the `@theme` block defining --color-... variables)
as unknown; update your Stylelint config (.stylelintrc.json) to allow this
at-rule by modifying the at-rule-no-unknown rule to ignore "theme" (and keep
"import" if already needed) so the `@theme` block passes linting without disabling
the rule globally.

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.

1 participant