Skip to content

Tailwind config overrides default blue color scale, breaking Tailwind ecosystem compatibility #6405

@zomians

Description

@zomians

Description

The `config/tailwind.config.js` generated during `rails generate solidus:install` overrides the `blue` color with a single hex value (`#2554B1`), which removes Tailwind's default blue color scale (`blue-50` through `blue-950`).

This breaks compatibility with:

  • Tailwind CSS official documentation examples
  • Tailwind UI and component libraries
  • Community tutorials and blog posts
  • Code portability from other projects
  • Developer expectations when using standard Tailwind colors

Steps to Reproduce

  1. Install Solidus with `rails generate solidus:install --auto-accept`
  2. Try to use standard Tailwind classes like `bg-blue-600` or `hover:bg-blue-500`
  3. The styles are not applied because these color variants don't exist

Example - Rails scaffold:
```bash
rails g scaffold Post content:text
```
Visit `/posts` - the "New post" button styling is broken.

Example - Copying from Tailwind docs:
Any component from https://tailwindcss.com/docs using `blue-*` classes won't work.

Expected Behavior

Developers should be able to use Tailwind's default color scale, or the custom color should have a unique name to avoid conflicts.

Actual Behavior

Classes like `bg-blue-600`, `text-blue-500`, etc. don't exist in the compiled CSS because the entire blue scale is replaced by a single color.

Current config (problematic):
```javascript
// config/tailwind.config.js line 72
extend: {
colors: {
blue: '#2554B1', // ← This replaces the entire blue scale
...
}
}
```

Impact

Breaking changes for:

  • ❌ Tailwind documentation examples
  • ❌ Tailwind UI components
  • ❌ Community code snippets
  • ❌ Rails scaffold (and other generators)
  • ❌ Developer experience (unexpected behavior)

Suggested Fixes

Option 1: Rename to avoid conflict (Recommended)
```javascript
extend: {
colors: {
'solidus-blue': '#2554B1',
// Tailwind's default blue scale remains available
}
}
```

Option 2: Define full color scale
```javascript
extend: {
colors: {
blue: {
DEFAULT: '#2554B1',
50: '#eff6ff',
100: '#dbeafe',
// ... define all variants
900: '#1e3a8a',
}
}
}
```

Option 3: Use Tailwind's color system properly
```javascript
const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
theme: {
extend: {
colors: {
'brand': '#2554B1',
// Keep default blue scale
blue: defaultTheme.colors.blue,
}
}
}
}
```

Environment

  • Solidus: 4.6.2
  • Rails: 8.0.4
  • Tailwind CSS: 3.4.x

Related

This affects any project using Tailwind CSS, not just Rails applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions