Skip to content

Fix color declarations #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: v1.0.0
Choose a base branch
from
Open

Conversation

louisescher
Copy link
Member

@louisescher louisescher commented Apr 8, 2025

Description

This PR introduces a breaking change to how colors are handled within StudioCMS UI. Before, we would use raw HSL values in order to be able to modify them later on:

:root {
	--background-base: 0 0% 6%;
}

This introduces an unnecessary hurdle to customization, since most other libraries ship with either their own color values and spaces or a different approach entirely. Thus, the goal of this PR is to replace this approach with a simpler one. We will now default to HSL functions instead of the raw values:

:root {
	--background-base: hsl(0 0% 6%);
}

Migrating from this can be a little tedious if the old system was used in custom components. I have created a regular expression that can be used with VSCode's (or any other IDE's) search & replace feature:

Search Value: hsl[a]?\((var\([A-Za-z-\d]+\))\)
Replace Value: $1

This (in most cases) should replace all instances with the now correct value. Please make sure to manually search for hsl(var( and hsla(var( after running the above to make sure all previous values have been replaced.

Summary by CodeRabbit

  • New Features

    • Introduced a more intuitive color declaration system, enhancing UI customization.
  • Style

    • Standardized color usage across key interface components, ensuring a consistent visual experience.
  • Documentation

    • Updated guides and examples to assist users in transitioning to the improved color system.

@louisescher louisescher requested a review from a team as a code owner April 8, 2025 08:44
Copy link

changeset-bot bot commented Apr 8, 2025

🦋 Changeset detected

Latest commit: 0390f79

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@studiocms/ui Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

coderabbitai bot commented Apr 8, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request refactors the way colors are declared across the project. It introduces a new method in the @studiocms/ui library by shifting from raw HSL values to HSL functions, and in many places replaces hsl()/hsla() calls with direct CSS variable references. The changes affect documentation, landing pages, and numerous UI component styles to standardize and simplify color definitions. Additionally, the documentation now includes a migration regex to assist in updating custom components.

Changes

File(s) Change Summary
.changeset/mean-carrots-accept.md, docs/.../docs/guides/customization.mdx, packages/.../css/colors.css Introduces a new color declaration method: shifts from raw HSL values to HSL functions and converts space-separated formats to uniform HSL notations with migration guidance.
docs/.../landing/*.astro, docs/.../landing/styles.css, docs/.../pages/index.astro, docs/.../starlightOverrides/SiteTitle.astro Updates landing page and site documentation by replacing hsl()/hsla() wrappers with direct CSS variable references for background, border, and text colors.
packages/studiocms_ui/src/components/*, packages/studiocms_ui/src/css/{prose,resets}.css, packages/.../toolbar/index.ts Refactors component styles (Accordion, Badge, Breadcrumbs, Button, Card, Checkbox, Modal, Progress, etc.) by eliminating the hsl()/hsla() functions in favor of direct variable usage for improved consistency and maintainability.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

pkg-pr-new bot commented Apr 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@studiocms/ui@96

commit: 0390f79

@withstudiocms-deployments
Copy link

withstudiocms-deployments bot commented Apr 8, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-04-11 17:32:11 CET

Copy link
Member

@Adammatthiesen Adammatthiesen left a comment

Choose a reason for hiding this comment

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

I both love and hate this... 😅

@Adammatthiesen
Copy link
Member

@coderabbitai review

Copy link

coderabbitai bot commented Apr 9, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
packages/studiocms_ui/src/components/Sidebar/Single.astro (1)

1-43: 💡 Verification agent

🧩 Analysis chain

Verify that component consumers are aware of this breaking change.

This file is part of the core UI component library, and the changes to color definition represent a breaking change as noted in the PR description. Consider adding documentation or migration notes to help users update their custom implementations.


🌐 Web query:

What's the best practice for communicating breaking changes in CSS variables?

💡 Result:

To effectively communicate breaking changes in CSS variables, adopt a structured approach that prioritizes clarity, documentation, and gradual transitions. Here are the best practices informed by industry standards and practical use cases:

Centralized Documentation

  • Maintain a dedicated reference (e.g., a VARIABLES.md file or style guide) listing all CSS variables, their purposes, and update histories[1][5][8].
  • Use semantic naming (e.g., --primary-color instead of --color1) to clarify intent, reducing ambiguity during updates[1][7].

Version Control & Deprecation Strategies

  • Introduce versioned prefixes (e.g., --v2-primary-color) for backward-incompatible changes, allowing parallel use during migration[10].
  • Flag deprecated variables with @deprecated comments in CSS files and documentation, specifying alternatives and removal timelines[1][4][8].
  • Retain deprecated variables temporarily with fallback values to prevent sudden breaks while transitioning:
    :root {
      --old-primary-color: var(--new-primary-color, #3498db); /* Fallback for legacy support */
    }

Collaboration & Tooling

  • Leverage CSS linting tools (e.g., Stylelint) to identify outdated variable usage in codebases[4][7].
  • Integrate variable changes into semantic versioning (e.g., major version bumps for breaking changes)[10].
  • Use automated alerts (e.g., GitHub Issues, Slack bots) to notify teams during build processes if deprecated variables are detected[8][9].

Gradual Migration Paths

  • Phase out changes incrementally using feature flags or environment-specific overrides[9][10].
  • Provide codemods or scripts to automate variable substitution in large codebases[5][7].

Examples in Practice

  • For a renamed variable:
    /* Deprecated: Use --new-text-color instead [2025-04-09] */
    --old-text-color: var(--new-text-color, #2ecc71);
  • In a component library, pair variable updates with visual regression testing to catch unintended side effects[2][9].

By combining clear communication channels with technical safeguards, teams can mitigate disruptions and ensure smooth transitions during CSS variable evolution[1][4][7][10].

Citations:


Action Required: Update Documentation for Breaking CSS Variable Changes

It appears that the changes in the Sidebar component (and likely elsewhere in the core UI library) introduce breaking changes in the CSS color definitions. To ensure component consumers are prepared for this transition, please consider the following updates:

  • Centralize Documentation: Add or update a dedicated reference (e.g., a VARIABLES.md or a dedicated migration section in the README) that lists the affected CSS variables, explains the rationale for the changes, and clearly enumerates new names or versioned changes.
  • Deprecation Warnings & Fallbacks: Document any deprecated CSS variables with @deprecated comments and provide fallback values where necessary to assist users with a smoother transition.
  • Migration Notes: Include clear migration instructions outlining the update timeline and suggesting codemods or scripts (if available) to help consumers update their custom implementations.

Following these steps will ensure that consumers of the component library clearly understand the breaking change and how to adapt their applications accordingly.

🧹 Nitpick comments (11)
packages/studiocms_ui/src/components/Select/select.css (1)

16-20: Update Disabled Label Color: The disabled select label now uses a direct CSS variable (var(--text-muted)) instead of an HSL function. This change aligns with the new color management strategy and simplifies theming.

.changeset/mean-carrots-accept.md (1)

1-28: Changeset Documentation Review: The changeset file clearly explains the new approach for color declarations, complete with examples and a migration regex. Consider revising the wording around line 7 to be more concise, and double-check that indentation is consistently applied using spaces (to satisfy markdownlint guidelines).

🧰 Tools
🪛 LanguageTool

[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...e. Before, we would use raw HSL values in order to be able to modify them later on: ```css...

(IN_ORDER_TO_PREMIUM)

🪛 markdownlint-cli2 (0.17.2)

10-10: Hard tabs
Column: 1

(MD010, no-hard-tabs)


18-18: Hard tabs
Column: 1

(MD010, no-hard-tabs)

packages/studiocms_ui/src/components/Button/button.css (2)

146-171: Consistent Updates for Success, Warning, and Other Themes
The flat, outlined, hover, and active states for success, warning, danger, info, and mono buttons have been revised to use direct variable references for backgrounds and borders. Note that in a few sections (e.g., danger flat text color defined via hsl(337, 92%, 71%) and light-theme overrides using raw HSL), raw HSL values remain. Consider verifying if these should be converted to CSS variables for full consistency.


355-389: Light Theme Specific Overrides
Within the [data-theme="light"] block, the updates for success and warning flat buttons are consistent; however, primary and danger flat buttons still use raw HSL values for text colors. Please review if these raw values are intended or if they should be replaced with corresponding variables to maintain full consistency across themes.

packages/studiocms_ui/src/components/Tabs/tabs.css (2)

63-65: Hover State Background for Default Tabs:
The hover state for .sui-tabs-container.default .sui-tab-header has been revised to use background-color: var(--default-flat-active) !important;. Although the use of !important may be necessary for specificity, please ensure it does not interfere with other style overrides.


67-69: Active Tab Background in Default Container:
For the active tab header, the background color is now set to var(--primary-flat-active) !important;. This update contributes to a consistent color scheme, but as with hover, please check that the usage of !important is truly warranted and doesn’t cause side effects.

docs/src/content/docs/docs/guides/customization.mdx (5)

27-29: Standardizing Primary Color Variables Format
The primary color variables are now defined using the HSL function with space-separated parameters (e.g. hsl(0 0% 100%)). Verify that your target browsers fully support this CSS Color Module Level 4 syntax.


41-43: Clarification of HSL Notation Requirement
The documentation now instructs users to provide HSL values without commas (e.g. hsl(0 0% 100%)). Consider adding a note on browser support or fallbacks if older browsers are a concern.


88-119: Consistency in HSL Notation for Dark Mode Variables
The dark mode table lists default color values using comma-separated HSL notation (e.g. hsl(0, 0%, 6%)), which is inconsistent with the space-separated format recommended above. Please verify whether the table defaults should be updated to match the new standard for consistency, or update the instructions if both formats are acceptable.


128-159: Consistency in HSL Notation for Light Mode Variables
Similar to dark mode, the light mode table uses comma-separated HSL values (e.g. hsl(0, 0%, 97%)). Confirm if these should be revised to the space-separated format to align with the recommendation stated in the documentation.


168-193: Typo in Non-Themed Color Variables Table
In the "Non-Themed Color Variables" table, the entry for --mono-flat is described as "Info flat color" which appears to be a copy-paste error. Please update this description to "Mono flat color" for clarity and correctness.

🧰 Tools
🪛 LanguageTool

[duplication] ~171-~171: Possible typo: you repeated a word.
Context: ...| |--text-dark| Dark text color |hsl(0 0% 0%)| |--default-flat` | Default flat c...

(ENGLISH_WORD_REPEAT_RULE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb5ab5a and 6ac95ab.

📒 Files selected for processing (37)
  • .changeset/mean-carrots-accept.md (1 hunks)
  • docs/src/components/landing/EcosystemSection.astro (1 hunks)
  • docs/src/components/landing/HeroSection.astro (1 hunks)
  • docs/src/components/landing/ShowcaseSection.astro (2 hunks)
  • docs/src/components/landing/SocialProofCard.astro (2 hunks)
  • docs/src/components/landing/styles.css (1 hunks)
  • docs/src/content/docs/docs/guides/customization.mdx (4 hunks)
  • docs/src/pages/index.astro (3 hunks)
  • docs/src/starlightOverrides/SiteTitle.astro (1 hunks)
  • packages/studiocms_ui/src/components/Accordion/accordion.css (2 hunks)
  • packages/studiocms_ui/src/components/Badge/badge.css (1 hunks)
  • packages/studiocms_ui/src/components/Breadcrumbs/breadcrumbs.css (1 hunks)
  • packages/studiocms_ui/src/components/Button/button.css (4 hunks)
  • packages/studiocms_ui/src/components/Card/card.css (2 hunks)
  • packages/studiocms_ui/src/components/Checkbox/checkbox.css (3 hunks)
  • packages/studiocms_ui/src/components/Divider/Divider.astro (1 hunks)
  • packages/studiocms_ui/src/components/Divider/divider.css (1 hunks)
  • packages/studiocms_ui/src/components/Dropdown/dropdown.css (7 hunks)
  • packages/studiocms_ui/src/components/Footer/footer.css (3 hunks)
  • packages/studiocms_ui/src/components/Input/input.css (2 hunks)
  • packages/studiocms_ui/src/components/Modal/modal.css (2 hunks)
  • packages/studiocms_ui/src/components/Progress/progress.css (2 hunks)
  • packages/studiocms_ui/src/components/RadioGroup/radiogroup.css (3 hunks)
  • packages/studiocms_ui/src/components/SearchSelect/searchselect.css (5 hunks)
  • packages/studiocms_ui/src/components/Select/select.css (7 hunks)
  • packages/studiocms_ui/src/components/Sidebar/Double.astro (2 hunks)
  • packages/studiocms_ui/src/components/Sidebar/Single.astro (1 hunks)
  • packages/studiocms_ui/src/components/Skeleton/skeleton.css (4 hunks)
  • packages/studiocms_ui/src/components/Tabs/tabs.css (3 hunks)
  • packages/studiocms_ui/src/components/Textarea/textarea.css (4 hunks)
  • packages/studiocms_ui/src/components/Toast/toaster.css (8 hunks)
  • packages/studiocms_ui/src/components/Toggle/toggle.css (5 hunks)
  • packages/studiocms_ui/src/components/User/user.css (2 hunks)
  • packages/studiocms_ui/src/css/colors.css (1 hunks)
  • packages/studiocms_ui/src/css/prose.css (2 hunks)
  • packages/studiocms_ui/src/css/resets.css (2 hunks)
  • packages/studiocms_ui/src/toolbar/index.ts (2 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/mean-carrots-accept.md

[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...e. Before, we would use raw HSL values in order to be able to modify them later on: ```css...

(IN_ORDER_TO_PREMIUM)

docs/src/content/docs/docs/guides/customization.mdx

[duplication] ~171-~171: Possible typo: you repeated a word.
Context: ...| |--text-dark| Dark text color |hsl(0 0% 0%)| |--default-flat` | Default flat c...

(ENGLISH_WORD_REPEAT_RULE)

🪛 markdownlint-cli2 (0.17.2)
.changeset/mean-carrots-accept.md

10-10: Hard tabs
Column: 1

(MD010, no-hard-tabs)


18-18: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (141)
docs/src/components/landing/styles.css (1)

3-3: LGTM - Updated color declaration

The change from hsl(var(--background-base)) to directly using var(--background-base) aligns with the PR objective of simplifying color declarations throughout the UI framework.

packages/studiocms_ui/src/components/Breadcrumbs/breadcrumbs.css (1)

12-12: LGTM - Updated color declaration

The change from hsl(var(--primary-base)) to directly using var(--primary-base) aligns with the PR objective of simplifying color declarations throughout the UI framework.

packages/studiocms_ui/src/components/Divider/Divider.astro (1)

22-22: LGTM - Updated color declaration in dynamic style

The change from background-color: hsl(var(--${background})) to directly using background-color: var(--${background}) aligns with the PR objective of simplifying color declarations throughout the UI framework. The component's dynamic behavior through props is preserved.

docs/src/components/landing/HeroSection.astro (1)

185-185: LGTM - Updated color declaration

The change from background-color: hsl(var(--background-step-1)) to directly using background-color: var(--background-step-1) aligns with the PR objective of simplifying color declarations throughout the UI framework.

docs/src/starlightOverrides/SiteTitle.astro (1)

124-124: Updated color definition to use direct CSS variable reference.

This change replaces color: hsl(var(--text-normal)); with color: var(--text-normal);, removing the HSL function wrapper. This aligns with the PR's objective to simplify color declarations across the codebase.

docs/src/components/landing/EcosystemSection.astro (1)

78-78: Simplified background color using direct CSS variable.

Removed the hsl() function wrapper around the CSS variable, changing from background-color: hsl(var(--background-step-1)); to background-color: var(--background-step-1);. This change is part of the broader effort to standardize color declarations.

packages/studiocms_ui/src/components/Card/card.css (3)

2-3: Updated color declaration pattern for card borders and background.

Removed the hsl() function wrapper around CSS variables, making the color declarations more direct. This change is consistent with the new approach to color management described in the PR.


10-10: Simplified filled card background color declaration.

Removed the hsl() function wrapper for a more direct CSS variable reference. This provides a cleaner way to define colors and aligns with the new color management strategy.


34-34: Updated card footer border color definition.

Removed the hsl() function wrapper from the border color definition, consistent with other changes in this PR to simplify color declarations.

packages/studiocms_ui/src/components/Sidebar/Single.astro (1)

16-17: Simplified sidebar color definitions.

Updated both background and border colors to use direct CSS variable references instead of HSL function wrappers. This makes the color system more straightforward and aligns with the PR's objective to streamline color declarations.

packages/studiocms_ui/src/components/Input/input.css (6)

11-11: LGTM! Simplified color variable usage.

The change from hsl(var(--text-muted)) to directly using var(--text-muted) aligns with the PR's objective to simplify color declarations.


21-23: LGTM! Consistent color variable simplification.

All three properties (border, background, and color) have been updated to use direct CSS variable references without the HSL function wrapper, maintaining consistency with the new approach.


28-28: LGTM! Simplified hover state background.

The hover state background has been updated to use the direct CSS variable reference.


33-35: LGTM! Consistent focus/active state styling.

Both border and background properties have been updated to use direct CSS variable references.


39-39: LGTM! Simplified disabled state border.

The border property for disabled active state has been updated to use the direct CSS variable reference.


43-43: LGTM! Simplified required indicator color.

The color property for the required indicator has been updated to use the direct CSS variable reference.

packages/studiocms_ui/src/components/Divider/divider.css (2)

15-15: LGTM! Simplified divider line background.

The background-color property has been updated to use the direct CSS variable reference, following the new color declaration pattern.


22-22: LGTM! Simplified divider content text color.

The color property has been updated to use the direct CSS variable reference, aligning with the PR objective.

packages/studiocms_ui/src/toolbar/index.ts (3)

100-102: LGTM! Simplified button default state styling.

All three properties (background-color, border-color, and color) have been updated to use direct CSS variable references, consistent with the new color declaration approach.


113-113: LGTM! Simplified button hover state background.

The hover state background-color has been updated to use the direct CSS variable reference.


117-117: LGTM! Simplified button active state background.

The active state background-color has been updated to use the direct CSS variable reference.

docs/src/components/landing/SocialProofCard.astro (2)

39-39: LGTM! Simplified card background.

The background-color property has been updated to use the direct CSS variable reference, consistent with the new color declaration approach.


64-64: LGTM! Simplified author handle text color.

The color property has been updated to use the direct CSS variable reference, aligning with the PR objective.

packages/studiocms_ui/src/css/resets.css (2)

9-9: Update Accent-Color Declaration

Changed the accent-color property from using an HSL function (implicitly) to directly referencing the CSS variable (var(--primary-base)). This simplifies the declaration and aligns with the new color management strategy.


23-24: Standardize Body Color Assignments

The color and background-color properties for the body element now directly use CSS variables (var(--text-normal) and var(--background-base)), which is consistent with our effort to simplify color definitions.

packages/studiocms_ui/src/components/Skeleton/skeleton.css (7)

11-20: Consistent Update in Keyframes for Pulse Animation

Replaced the previous HSL-based color declarations with direct CSS variable references (e.g., var(--background-step-2) and var(--background-step-3)). This change ensures that the pulse animation remains consistent with our new theming approach.


22-29: Update Skeleton Element Background

The .sui-skeleton element’s background color is now defined with var(--background-step-2), which helps maintain a unified styling strategy across components.


31-39: Standardize Card Background Color

The .sui-skeleton-card now uses var(--background-step-1) for its background. This change simplifies color management and promotes consistency within the skeleton component styles.


69-73: Uniform Background for Text Skeleton

Updated .sui-skeleton-text to use var(--background-step-2) directly, ensuring that the text skeleton aligns with the standardized color scheme.


75-80: Consistent Background in Block Skeleton

The .sui-skeleton-block’s background color is now set to var(--background-step-2), further reinforcing uniformity in our component styling.


81-88: Uniform Background for Circle Skeleton

The .sui-skeleton-circle now applies var(--background-step-2) for its background color, matching the approach used in similar skeleton components.


105-112: Updated Animation Background Image

The background-image in the .sui-skeleton-anim-slide selector has been updated to use CSS variables (e.g., var(--background-step-2) and var(--background-step-3)), ensuring that animated elements are in line with the new color declaration format.

packages/studiocms_ui/src/components/User/user.css (2)

8-18: Simplify Avatar Styling with CSS Variables

Updated the .sui-avatar-container to use var(--default-base) for the background color and var(--border) for the border. This directly implements our new color approach and simplifies future theme modifications.


36-39: Update Text Color Handling in Description

Replaced the HSL function with a direct variable reference (var(--text-muted)) in .sui-description, ensuring consistency with the project's updated color management methods.

packages/studiocms_ui/src/components/Toast/toaster.css (7)

9-9: Simplify Toaster Text Color Definition

The color property for #sui-toaster now directly uses var(--text-normal), which aligns with our migration away from HSL-based declarations.


27-33: Standardize Toast Container Styling

Within the .sui-toast-container rule, the properties for border, background-color, and box-shadow have been updated to employ direct CSS variable references. This change enhances consistency and makes the component easier to maintain.


60-78: Update Toast Header Icon Colors

The SVG icons in the toast header now use direct variable references (e.g., var(--primary-base), var(--success-base), var(--warning-base), var(--danger-base), var(--info-base), and var(--mono-base)) instead of the HSL function. This streamlines the styling and improves clarity across different toast types.


84-92: Refine Toast Progress Bar Colors

The progress bar’s background-color now directly references var(--primary-base) in its default state, with subsequent updates for variant classes. This revision is in line with our standardized color strategy.


114-132: Improve Close Icon Focus and Hover Styles

The hover state for .close-icon-container and its focus-visible outline now use var(--default-base) and var(--text-normal) respectively, providing consistent visual feedback in accordance with the new color definitions.


138-152: Consistent Border Colors in Persistent Toast Containers

Updated the border styles for .sui-toast-container.persistent and its variant states (success, warning, danger) to use the respective CSS variables. This change simplifies the CSS and aids in future theming adjustments.


155-189: Ensure Consistency in Keyframe Transitions

Within the @keyframes toast-closing, the border properties across different animation stages are now defined using direct CSS variable references. This ensures a smooth and thematically consistent transition effect during the toast closing animation.

packages/studiocms_ui/src/components/Footer/footer.css (3)

5-7: Standardize Footer Background and Text Colors

The footer now uses var(--background-step-1) for its background and var(--text-normal) for its text, aligning the component with our updated color scheme while ensuring a cohesive appearance.


31-35: Uniform Text Color in Footer Links

By updating .links ul li, .links ul li * to use var(--text-normal), the links’ text now benefits from a uniform color scheme that matches the overall footer style.


49-51: Update Footer Separator Styling

The .separator now directly utilizes var(--border) for its background, simplifying the style and keeping it consistent with the project's standardized color declarations.

packages/studiocms_ui/src/components/Select/select.css (13)

26-29: Simplified .req-star Color Declaration: The .req-star class now sets its color directly to var(--danger-base), which improves clarity and consistency across the UI.


31-44: Updated .sui-select-button Styling: The button’s border, background, and text color are now defined via direct CSS variable references (e.g. var(--border), var(--background-step-2), var(--text-normal)). This standardization makes theme adjustments simpler.


46-49: Button Focus State Border Update: The focus state now explicitly uses 1px solid var(--primary-base) for the border, ensuring a consistent focus indicator across components.


50-53: Button Hover Background Update: Changing the hover background to var(--background-step-3) maintains visual consistency with the overall updated color scheme.


55-60: Active Button Styling Adjustments: Active and pressed states now rely on direct variable references for the border and background. This helps maintain consistency in interactive feedback.


82-98: Dropdown Styling Standardization: The dropdown element now uses var(--border) for its border, var(--background-step-2) for its background, and var(--shadow) for its box-shadow. These changes ensure that dropdown styles match the new design guidelines.


116-119: Disabled Option Color Simplification: Updating the disabled option color to var(--text-muted) improves consistency with other disabled state elements.


121-125: Option Hover Background Update: The hover state for options now uses var(--background-step-3), aligning with the updated color scheme across the component.


127-131: Multiple Select Option Highlighting: The background for selected options in multiple select scenarios is updated to var(--primary-hover), which should provide a clear visual cue consistent with the new styling.


138-143: Selected Option Styling Standardized: By setting the selected option’s background to var(--primary-base) and text to var(--text-inverted), the component now adheres closely to the revised color guidelines.


187-198: Badge SVG Outline Adjustment: The SVG inside badge containers now uses an outline of 1px solid transparent, which improves consistency during focus transitions.


203-208: Badge SVG Focus Outline Update: Updating the focus/active state outline to 1px solid var(--border) provides a coherent visual feedback that matches other components.


210-214: Max Span Text Color Standardization: The text color of .sui-select-max-span is updated to var(--text-muted), which fits the overall intent of using the direct variable references for subdued text styling.

packages/studiocms_ui/src/components/Accordion/accordion.css (5)

35-39: Accordion Border Update: The border for both .sui-accordion.outlined and .sui-accordion.filled is now defined using var(--border), which enhances consistency across the component.


41-43: Filled Accordion Background Update: Updating the background color for filled accordions to var(--background-step-1) aligns with the new color declaration strategy.


45-49: Accordion Item Border Refinement: The border applied to accordion items now directly employs var(--border), ensuring a unified style across item boundaries.


51-53: First Accordion Item Border Top Update: The first accordion item now has its top border set to var(--border), which maintains consistent styling from top to bottom.


60-66: Accordion Summary Text Color Standardization: The summary text color is now set to var(--text-normal), ensuring that the announcement of accordion options is visible and harmonious with the updated UI palette.

packages/studiocms_ui/src/components/Badge/badge.css (20)

15-18: Primary Badge Color Standardization: Primary badges now utilize var(--primary-base) for the background and var(--text-inverted) for the text, which aligns perfectly with the revised design language.


20-24: Primary Badge Variant Adjustments: For flat and outlined primary badges, switching the background to var(--primary-flat) and the text to var(--primary-base) creates a clear distinction between variants under the new styling approach.


26-28: Outlined Primary Badge Border Update: Setting the outlined primary badge border as 1px solid var(--primary-base) upholds visual consistency with other outlined elements.


30-33: Success Badge Color Standardization: The success badge is now updated to use var(--success-base) for its background and var(--text-inverted) for its text, reinforcing the uniform color strategy.


35-39: Success Badge Variant Adjustments: Flat and outlined success badges now correctly reference var(--success-flat) (background) and var(--success-base) (text), ensuring the variants remain distinct yet harmonious.


41-43: Outlined Success Badge Border Update: A border defined as 1px solid var(--success-base) confirms that outlined success badges adhere to the standard color guidelines.


45-48: Warning Badge Color Standardization: The warning badge now directly uses var(--warning-base) for its background with var(--text-inverted) for its text, which simplifies and clarifies its styling.


50-54: Warning Badge Variant Adjustments: For flat and outlined warning badges, applying var(--warning-flat) as the background and var(--warning-base) for text maintains a consistent variant distinction.


56-58: Outlined Warning Badge Border Update: The outlined variant now uses a border of 1px solid var(--warning-base), keeping the visual style consistent with other badge types.


60-63: Danger Badge Color Update: The danger badge’s background is now set to var(--danger-base) with var(--text-normal) for text, ensuring clear and consistent visual cues.


65-69: Danger Badge Variant Adjustments: In its flat and outlined forms, the danger badge now references var(--danger-flat) across the background while its variant text remains var(--danger-base), furthering design uniformity.


71-73: Outlined Danger Badge Border Update: The outlined danger badge is now bordered with 1px solid var(--danger-base), aligning with the overall styling shifts.


75-78: Info Badge Color Standardization: The info badge now employs var(--info-base) for its background and var(--text-normal) for its text; this creates a clear and immediately recognizable visual style.


80-84: Info Badge Variant Adjustments: For flat and outlined info badges, the background now comes from var(--info-flat) while the text uses var(--info-base), ensuring variants remain distinct yet consistent.


86-88: Outlined Info Badge Border Update: The border for info badges in outlined form is updated to 1px solid var(--info-base), which supports a unified interface aesthetic.


90-93: Mono Badge Color Standardization: Mono badges now reliably use var(--mono-base) for background and var(--text-inverted) for text, ensuring clarity and cohesion.


95-99: Mono Badge Variant Adjustments: The flat and outlined variants receive var(--mono-flat) as their background, with text color switching to var(--mono-base), aligning them with the new color paradigm.


101-103: Outlined Mono Badge Border Update: The outlined mono badge now features a border of 1px solid var(--mono-base), which contributes to a consistently clean design.


105-107: Data-theme Light Danger Badge Adjustment: For light-themed contexts, the danger badge text is updated to var(--text-inverted) for better contrast.


109-111: Data-theme Light Info Badge Adjustment: Likewise, the info badge in a light theme now uses var(--text-inverted) for its text, ensuring readability and design consistency.

packages/studiocms_ui/src/components/Modal/modal.css (3)

1-6: Modal Component Styling Update: The modal now uses a border of 1px solid var(--border) and a box-shadow of 0px 4px 8px var(--shadow) (with a reduced vertical offset). These changes help the modal integrate seamlessly with the new color declaration approach.


63-65: X-Mark Container Hover Update: The hover effect for the .x-mark-container has been updated to use var(--default-base) for its background, ensuring consistency with the refreshed color strategy.


67-70: X-Mark Container Focus-Visible Outline Update: The focus-visible outline now correctly applies 2px solid var(--text-normal), boosting accessibility and providing a clear focus indicator.

packages/studiocms_ui/src/components/Dropdown/dropdown.css (1)

19-19: Color handling standardized to direct CSS variable references

These changes align with the PR objective of simplifying color declarations by removing the hsl() function wrapper and using CSS variables directly. This makes the code more readable and easier to maintain.

Also applies to: 31-31, 55-55, 68-68, 86-86, 146-146, 156-156, 160-166, 174-175, 183-184, 192-193, 201-202, 210-211, 215-215

packages/studiocms_ui/src/components/Checkbox/checkbox.css (1)

13-13: Color property standardization improves consistency

These changes successfully transition from using hsl(var(--color-variable)) to the simpler var(--color-variable) format. This approach improves readability and aligns with the breaking change described in the PR objectives.

Also applies to: 20-22, 29-30, 34-35, 38-39, 67-69, 72-74, 77-79, 82-84, 87-89, 92-94, 97-98, 111-112, 115-116, 119-120, 123-124, 127-128, 131-132, 135-136

packages/studiocms_ui/src/css/colors.css (1)

13-17: HSL function implementation for color variables looks good

The colors have been successfully converted to use explicit HSL functions, which makes customization much clearer and aligns with the PR objectives.

Also applies to: 18-22, 23-25, 27-86, 91-118, 120-131

docs/src/pages/index.astro (1)

118-119: Landing page color references updated to match new pattern

The color properties have been successfully updated to use direct CSS variable references rather than wrapping them in hsl() functions. This change is consistent with the rest of the codebase and improves readability.

Also applies to: 129-130, 135-136, 176-177

docs/src/components/landing/ShowcaseSection.astro (2)

78-78: Simplify Background Color Declaration
The update from using hsl(var(--background-step-1)) to a direct reference (var(--background-step-1)) streamlines the CSS and reduces unnecessary function wrapping. Please ensure that the global definition of --background-step-1 is correct.


101-101: Update Preview-Container Background Declaration
Replacing hsl(var(--background-base)) with var(--background-base) makes the code more straightforward and consistent with the new color management approach.

packages/studiocms_ui/src/components/RadioGroup/radiogroup.css (9)

7-10: Use Direct Variable in Disabled Container
Updating the disabled container’s text color to var(--text-muted) (instead of wrapping it in hsl()) improves clarity and consistency across themes.


12-16: Consistent Color Reference for Disabled Labels
The change to use var(--text-muted) in .sui-radio-label.disabled aligns with the overall update and simplifies color management.


18-21: Update Highlight for Required Star
Using var(--danger-base) directly for .req-star is a clear improvement over the previous raw hsl() wrapping.


41-43: Streamline Hover State Styling
The update for .sui-radio-label:hover .sui-radio-box to use var(--default-hover) ensures consistency with the new color declarations.


45-48: Verify Active State Transformation
While updating the active state’s outline color to var(--default-active) is good, please verify the use of scale: 0.9;—typically CSS transforms use transform: scale(0.9);. Confirm browser support or correct if necessary.


50-53: Update Checked State Colors
Replacing the hsl-wrapped color with direct var(--text-normal) for the checked radio box state is clear and consistent.


55-58: Primary Theme Consistency
The update in the primary theme block (using var(--primary-base)) is applied correctly. All similar blocks for success, warning, danger, info, and mono themes follow the same pattern—good consistency overall.


95-103: Update Radio Box Outline
Changing the outline definition to 1px solid var(--default-base) ensures that the styling remains consistent with the updated variable approach.


104-106: Improve Focus-Visible Styling
Using outline-color: var(--text-normal) !important; in the focus-visible state aligns with the new theme standards.

packages/studiocms_ui/src/components/Sidebar/Double.astro (2)

30-32: Standardize Sidebar Outer Styling
The replacement of hsl(var(--background-step-1)) with var(--background-step-1) and similarly using var(--border) for the border is clear and aligns with the new approach.


46-48: Standardize Sidebar Inner Styling
Similarly, updating the inner sidebar’s background-color and border-right properties to use direct variable references improves maintainability and consistency.

packages/studiocms_ui/src/components/Button/button.css (6)

27-29: Default Button Style Update
The default colorway now directly uses CSS variables (var(--default-base), var(--border), and var(--text-normal)), which simplifies the color declarations and enhances theme consistency.


48-50: Outlined Button Hover State
Updating the hover state for outlined buttons to use var(--default-hover) is concise and aligns with the overall refactor effort.


56-63: Enhanced Hover and Active States
The changes in the hover and active states (using var(--default-hover) and var(--default-active) along with a transform for active state scaling) are well implemented.


105-109: Primary Button Colorway Update
Primary button styles now correctly reference var(--primary-base) for background and border, and var(--text-inverted) for text.


112-118: Outlined Primary Button Styling
The outlined primary button’s updated background and text color further ensure consistency with the new color management strategy.


133-139: Review Flat Button Color Declaration (Primary)
The primary flat button now uses var(--primary-flat) for its background; however, the text color remains defined as hsl(259, 96%, 79%). This reintroduces a raw HSL value into the codebase. Please verify whether this is intentional or if it should be updated to a CSS variable for consistency.

packages/studiocms_ui/src/css/prose.css (2)

3-19: Streamline Prose Component Color Variables
The update to replace hsl(var(--color-variable)) with direct variable references (e.g., var(--text-dimmed), var(--text-normal), etc.) cleans up the CSS and makes customization simpler. These changes effectively align with the new color declaration methodology.


248-249: Code Element Background Update
Changing the code element’s background from hsl(var(--background-step-3)) to var(--background-step-3) simplifies the styling and adheres to the standardized approach for color declarations.

packages/studiocms_ui/src/components/Textarea/textarea.css (5)

8-12: Disabled Label Color Consistency:
In the .sui-textarea-label.disabled block, the color has been changed from using an HSL function to a direct variable reference (color: var(--text-muted);). This update not only simplifies the declaration but also aligns well with the new color management strategy. Please verify that the CSS variable --text-muted holds the correct color value as previously computed by hsl(var(--text-muted)).


27-32: Textarea Core Styling Update:
The changes on lines 30–32 update the textarea’s border, background, and text color to use CSS variables directly. This improves consistency and maintainability, as it adheres to the new approach of using variable references in place of raw HSL calls.


40-42: Hover State Background Update:
In the hover state for .sui-textarea, the background is now defined as var(--background-step-3). This change is consistent with the overall theme migration. Verify that the new variable provides the intended visual highlight on hover.


48-53: Active/Focus State Adjustments:
The active and focus state styles now use var(--primary-base) for the border and var(--background-step-2) for the background. This refactoring is in line with the project-wide color strategy. It is advisable to check the accessibility contrast for these states to ensure they meet UI guidelines.


55-57: Required Star Color Update:
The .req-star element now uses var(--danger-base) for its color, which is consistent with the simplified color declarations across the codebase.

packages/studiocms_ui/src/components/Progress/progress.css (3)

1-4: Progress Component Border Update:
The border for the progress container has been updated from hsl(var(--border)) to var(--border). This direct use of the CSS variable reduces complexity and ensures consistency with the new color handling method.


9-14: Slider Primary Color Update:
Within .sui-progress-slider, the background color is now set to var(--primary-base). This change standardizes the color reference and should help maintain a consistent appearance across components.


17-19: Status-Based Slider Color Refinement:
The background colors for the slider in its various status states (success, warning, danger, info, monochrome) have all been updated to use their respective CSS variables. Please ensure that each variable (e.g., --success-base, --warning-base, etc.) is correctly defined to produce the intended color output.

packages/studiocms_ui/src/components/Toggle/toggle.css (6)

10-13: Disabled Toggle Label Color Update:
In the .sui-toggle-label.disabled declaration, the color transition to var(--text-muted) enhances consistency with other disabled elements in the application.


20-27: Toggle Container Background Update:
The background for the toggle container has been updated to var(--default-base), which simplifies the color styling. This now directly reflects the intended color design via a CSS variable.


33-38: Toggle Switch Color Tuning:
The .sui-toggle-switch now uses var(--text-muted) for its background color. This update aligns the toggle switch styling with the overall refactor. It would be good to verify that this color provides adequate contrast in both active and inactive states.


45-47: Focus-visible Outline Adjustment:
The focus-visible styling for the toggle switch has been updated to outline: 2px solid var(--text-normal). This change improves consistency; however, please double-check that the contrast and focus indication remain clear for accessibility purposes.


50-53: Checked Toggle Switch Styling:
For the checked state – as seen in the .sui-toggle-container:has(.sui-toggle-checkbox:checked) .sui-toggle-switch rule – the background color update to var(--text-normal) helps maintain a uniform design. Ensure that this visually differentiates the checked state as intended.


73-101: Toggle Label Variants and Active State Updates:
The update for toggle label classes (e.g., .primary, .success, .warning, .danger, .info, .mono) now uses direct variable references for their backgrounds. Additionally, the mono variant’s toggle switch now has a border defined as 1px solid var(--text-inverted), and the .req-star color is updated accordingly. Overall, these changes create a cohesive color system. Please verify that the new variable values deliver the desired visual outcomes across different component states.

packages/studiocms_ui/src/components/Tabs/tabs.css (4)

58-61: Default Tab Header Focus-visible Update:
The focus-visible style for default tab headers now uses outline: 2px solid var(--text-normal). This change aligns with the refactored color management and should maintain proper focus visibility for accessibility.


71-77: Status-Specific Active Tab Backgrounds:
The modifications for tab headers with status classes (e.g., .success.active, .warning.active, .danger.active, and their variants) now use their corresponding CSS variables (--success-flat-active, --warning-flat-active, etc.). This is a clear improvement in maintainability. Ensure that these variables reflect the appropriate colors for each status.


87-89: Starlight Tab Headers Color Adjustments:
In the starlight-themed tab container, the tab header text and active states have been updated (e.g., changing text colors to var(--text-muted) and var(--text-normal), and the active underline to var(--primary-base)). These refinements are well aligned with the new approach. Confirm that these changes meet the design requirements and accessibility standards.


127-135: Focus-visible Styling for Starlight Tabs:
The focus-visible pseudo-element for starlight tab headers now features a border (2px solid var(--primary-base)) and an outline (1px solid var(--text-normal)). This detailed focus styling is critical for accessibility—please ensure cross-browser compatibility and that the focus indication is prominent.

packages/studiocms_ui/src/components/SearchSelect/searchselect.css (12)

14-18: Disabled SearchSelect Label Color Update:
In the .sui-search-select-label.disabled rule, the color change to var(--text-muted) is consistent with similar updates across the codebase. This should maintain visual uniformity for disabled elements.


24-27: Required Star Color Consistency:
The .req-star element’s color has been modified to use var(--danger-base), ensuring consistency with other components that signal danger or required fields.


38-42: Dropdown Border and Background Updates:
The .sui-search-select-dropdown now uses a border defined as 1px solid var(--border) and a background set to var(--background-step-2). Both changes simplify the color declarations and maintain alignment with the new theme guidelines.


53-54: Dropdown Box-shadow Refinement:
The dropdown’s box-shadow now uses 0px 4px 8px var(--shadow) instead of an HSL-based value. Please confirm that the --shadow variable produces a visually acceptable shadow effect that matches the design intent.


70-72: Empty Search Results Hover State:
For empty search results, updating the hover background color to var(--background-step-2) aligns with the revised color strategy.


76-77: Disabled Option Color Update:
The styling for .sui-search-select-option.disabled now uses var(--text-muted), ensuring that disabled options are styled consistently across the UI.


79-82: Option Hover and Focus States:
The hover and focused states for search select options have been updated to use var(--background-step-3), which should provide a clear interactive feedback while adhering to the revised color scheme.


87-88: Multiple Select Option Hover Background:
The background color for multiple select options when hovered/ focused now uses var(--primary-hover), in alignment with the new declarations.


91-93: Selected Option Styling:
The styling for a selected option is now defined with background-color: var(--primary-base) and color: var(--text-inverted). This direct reference provides improved clarity and easier theme maintenance.


168-170: Badge SVG Outline Default:
The SVG outline in the badge container now defaults to 1px solid transparent, helping to avoid any unintended visual borders while still allowing for clear focus states when active.


179-180: Badge SVG Active/Focus Outline:
Updating the SVG outline to 1px solid var(--border) during active and focus states ensures a consistent interaction style. Please verify that this change supports sufficient visual feedback during these states.


183-185: Max Span Text Color Update:
The color for .sui-search-select-max-span has been switched to var(--text-muted), matching similar disabled or placeholder text styles across the application.

docs/src/content/docs/docs/guides/customization.mdx (1)

33-35: Updated Light Theme Primary Color Variables
The light theme now defines primary colors using HSL with space-separated values (e.g. hsl(0 0% 0%)). Please confirm that these values yield the desired visual outcome for the light theme.

Copy link
Member

@Adammatthiesen Adammatthiesen left a comment

Choose a reason for hiding this comment

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

(see bot comment)

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