Skip to content

Conversation

@bmanquen
Copy link
Collaborator

@bmanquen bmanquen commented Jan 8, 2026

No description provided.

@bmanquen bmanquen requested a review from cameronapak January 8, 2026 18:40
@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: a33098e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR refactors the CSS build process to use PostCSS instead of the Tailwind CLI with a post-processing script, modernizing the build pipeline and consolidating CSS transformations into a single tool.

Key Changes:

  • Replaced the two-step build process (Tailwind CLI + custom Node.js script) with a unified PostCSS pipeline
  • Added PostCSS dependencies: @tailwindcss/postcss, postcss-cli, autoprefixer, and cssnano
  • Created postcss.config.js with a custom plugin to remove @layer wrappers (replaces the deleted strip-layers.js script)
  • Updated build:css script to use postcss command instead of tailwindcss CLI
  • The new pipeline processes CSS in order: Tailwind → autoprefixer → layer removal → minification

Benefits:

  • More maintainable: uses standard PostCSS plugin architecture instead of custom string parsing
  • Better integration: all CSS transformations happen in one pipeline
  • Adds autoprefixer support for better browser compatibility

Confidence Score: 4/5

  • This PR is safe to merge with minor cleanup recommended
  • The refactoring is well-structured and achieves the stated goal of modernizing the CSS build process. The PostCSS approach is more maintainable than custom string parsing. One minor style issue: a debug console.log statement should be removed before production
  • packages/ui/postcss.config.js - remove console.log statement on line 10

Important Files Changed

File Analysis

Filename Score Overview
packages/ui/package.json 5/5 Added PostCSS dependencies (@tailwindcss/postcss, postcss-cli, autoprefixer, cssnano) and updated build script to use PostCSS instead of Tailwind CLI
packages/ui/postcss.config.js 4/5 New PostCSS configuration with Tailwind, autoprefixer, custom layer removal plugin, and cssnano. Contains minor console.log that should be removed
packages/ui/scripts/strip-layers.js 5/5 Removed custom Node.js script that manually parsed and stripped @layer wrappers - functionality replaced by PostCSS plugin

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Build as Build Script
    participant PostCSS as PostCSS CLI
    participant TW as @tailwindcss/postcss
    participant AP as Autoprefixer
    participant RL as removeLayersPlugin
    participant CN as cssnano
    participant Out as dist/tailwind.css

    Note over Dev,Out: Old Build Process (Before)
    Dev->>Build: pnpm build:css
    Build->>TW: tailwindcss --minify
    TW->>Out: Generate CSS with @layer wrappers
    Build->>Out: node scripts/strip-layers.js
    Note over Out: Manual string parsing to remove @layers

    Note over Dev,Out: New Build Process (After)
    Dev->>Build: pnpm build:css
    Build->>PostCSS: postcss src/styles/global.css
    PostCSS->>TW: Process Tailwind directives
    TW-->>PostCSS: CSS with @layer wrappers
    PostCSS->>AP: Add vendor prefixes
    AP-->>PostCSS: Prefixed CSS
    PostCSS->>RL: Remove @layer wrappers
    RL-->>PostCSS: Unwrapped CSS
    PostCSS->>CN: Minify CSS
    CN-->>PostCSS: Minified CSS
    PostCSS->>Out: Write final CSS
Loading

AtRule: {
layer: (atRule) => {
// Unwrap the contents and remove the @layer wrapper
console.log('Found @layer:', atRule.params);
Copy link
Contributor

Choose a reason for hiding this comment

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

console.log statement left in production code

Suggested change
console.log('Found @layer:', atRule.params);
// Unwrap the contents and remove the @layer wrapper

Copy link
Collaborator

@cameronapak cameronapak left a comment

Choose a reason for hiding this comment

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

Hey, before I approve, have you read these methods?:

  1. tailwindlabs/tailwindcss#13188 (comment)

  2. tailwindlabs/tailwindcss#13188 (comment)

@cameronapak cameronapak changed the title refactor(ui): add postcss to compile css and remove layers YPE-1009: refactor(ui): add postcss to compile css and remove layers Jan 9, 2026
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.

3 participants