feat(core): enhance dark-aware component with theming #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major upgrade to the dark mode awareness system across the documentation and core CSS. The main improvements include support for container-relative theming, perceptual contrast in the OKLCH color space, and visual adaptations such as border glow and font-weight adjustments. Additionally, the documentation and demo components are enhanced to showcase and explain these features, including the ability to preview components in light, dark, or split themes.
Dark Mode Awareness and Theming Enhancements:
s-dark-awareutility infunctions.cssis now a sophisticated system that adapts to both system and parent container themes, computes readable text color using OKLCH, and visually adapts with border glow and dynamic font weight for optimal contrast and legibility. Variants for "subtle" and "strong" adaptations are introduced.s-dark-awareis expanded to explain the new system, including container-relative theming, perceptual contrast, theme islands, and the technical rationale behind each adaptation. New demos illustrate its behavior in light, dark, and split contexts.Demo Component and Documentation Improvements:
Demo.astrocomponent now accepts athemeprop ('dark' | 'light' | 'split') to force the demo preview into a specific theme or show both light and dark side-by-side. The rendering logic and container classes are updated to support this, enabling accurate previews for theme-aware components.