Minor Changes
This release introduces enhanced theme flexibility and significantly improved consent callbacks with structured data responses.
β¨ New Features
Comprehensive Theming Support
useColorSchemenow detects themes via the.darkclass ondocument.documentElement- Optional
colorSchemeparameter improves integration with existing theme systems - Full test suite added to validate dark/light/system theme switching
- Theme system now uses
@layer basefor better CSS encapsulation
Improved Consent Callbacks
- Callbacks now return structured and useful consent data
- Works consistently across offline, c15t, and backend-connected modes
- Callback responses now reflect user-selected preferences more clearly
π Bug Fixes
- #203 4d47e21 β fix(core): callbacks not working in c15t mode. Thanks @KayleeWilliams!
- Fixed callbacks not firing in alternate modes (e.g., c15t)
useColorSchemenow correctly responds to:- System preference changes
- Document class changes (via MutationObserver)
- Improved error handling for environments missing
matchMedia - Removed unnecessary localStorage dependency for theme persistence
ποΈ Refactors
- Theme-related CSS is now consistently structured using
@layer base - Refined internal theme types to allow better extension/customization
- Simplified theme config to support nested object structure for banners and widgets
π Documentation
- Fixed broken example in offline mode β #187
- Updated configuration types to document new theme and colorScheme options