X (Twitter)

Discord

GitHub1.1k
2.625 min read

v1.1.5 โ€” Tailwind CSS v3 Compatibility & Style Fixes

Posted By

Christopher Burns
Consent Team
Christopher Burns

Patch Changes

This release addresses critical Tailwind CSS v3 compatibility issues and improves theme handling for components with custom styling requirements.

๐Ÿ› Bug Fixes

Tailwind CSS v3 Compatibility

Key Fixes

  • Removed CSS layering wrappers that caused conflicts with Tailwind CSS v3
  • Fixed noStyle theme handling to properly exclude default component styles when noStyle flag is set
  • Ensured theme-level classNames and styles are still applied even with noStyle: true

๐Ÿ”ง Technical Details

CSS Layer Removal

  • Removed @layer wrappers from multiple components to prevent Tailwind CSS v3 collisions
  • This change maintains functionality while ensuring compatibility with modern Tailwind configurations

Enhanced noStyle Theme Support

  • Added proper checks for noStyle flag in component themes
  • When noStyle is enabled, only theme-level styling is applied
  • Default component styles are correctly excluded

โš ๏ธ Breaking Changes

Custom Class Priority

With the removal of CSS layers, you may need to add !important to custom classes for proper specificity:

/* Before */
.my-custom-banner {
  border: 1px solid red;
}

/* After - if styles don't apply */
.my-custom-banner {
  border: 1px solid red !important;
}

Or use Tailwind's important prefix:

// Before
<div className="border-red-500">

// After - if needed
<div className="!border-red-500">

๐ŸŽฏ Use Cases

NoStyle Theme Implementation

// Theme with noStyle flag
const customTheme = {
  noStyle: true,
  classNames: "my-custom-styles",
  styles: { backgroundColor: "blue" }
};

// Only theme-level styles applied, no default component styles
<CookieBanner theme={customTheme} />

Tailwind CSS v3 Compatibility

// Now works seamlessly with Tailwind CSS v3
import { CookieBanner } from '@c15t/react';

// No more layer conflicts
<CookieBanner className="border-2 border-blue-500 rounded-lg" />

๐Ÿงช Testing

Test Coverage

  • โœ… Added comprehensive test cases for noStyle flag behavior
  • โœ… Verified CSS layer removal doesn't break existing functionality
  • โœ… Enhanced test descriptions for clarity
  • โœ… Added coverage for mixed theme formats (strings and objects)

Validation Scenarios

  • Theme with noStyle: Ensures only theme-level styles are applied
  • Tailwind CSS v3: Confirms no layer conflicts in modern Tailwind setups
  • Mixed theme formats: Validates both string and object theme configurations

โœจ What's Changed

Published via commit 0d421be by @github-actions

Full Changelog: @c15t/react@1.1.4...@c15t/react@1.1.5

This release ensures seamless Tailwind CSS v3 compatibility while providing more robust theme customization options through improved noStyle handling.

Thank you to our contributors

c15t.com