Skip to content
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

feat(theme): [button] submit the initial version of aurora-theme-vars #2596

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

MomoPoppy
Copy link
Collaborator

@MomoPoppy MomoPoppy commented Dec 3, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive set of CSS custom properties for theming, enhancing styling flexibility and consistency across the application.
    • Updated button activation styles to align with hover effects for improved visual feedback.
    • Enhanced calendar component hover styling for better user experience.
    • Improved specificity in styling for disabled option components.
    • Added new variable for unchecked icons when disabled to enhance state management.
  • Bug Fixes

    • Corrected hover state styling for selected box icons to ensure proper color application.
  • Documentation

    • Added comments in Chinese for clarity on the intended use of various color variables.
  • Chores

    • Updated variable definitions for pagination items to improve visual distinction in active and hover states.

Copy link

coderabbitai bot commented Dec 3, 2024

Walkthrough

The changes in this pull request introduce a new CSS file, aurora-theme.less, which defines a comprehensive set of CSS custom properties for theming, including color, typography, spacing, and shadow variables. Additionally, the index.less file is updated to include a commented import statement for the new theme. Other files have undergone extensive modifications to existing CSS variables, enhancing the organization and clarity of the theme's styling system across various components.

Changes

File Path Change Summary
packages/theme/src/base/aurora-theme.less New CSS custom properties for theming, including colors, typography, spacing, and shadows.
packages/theme/src/base/index.less Added commented import statement for aurora-theme.less.
packages/theme/src/base/old-theme.less Extensive modifications to color variables, adding new ones for various UI states and purposes.
packages/theme/src/base/vars.less Added and updated numerous CSS custom properties for colors, typography, spacing, and shadows.
packages/theme/src/breadcrumb/index.less Removed font-family property from & &__separator.
packages/theme/src/button/vars.less Updated button active state colors to use hover variants instead.
packages/theme/src/calendar/vars.less Updated hover background color variable for calendar days.
packages/theme/src/option/index.less Refined styles for the .is-disabled state of the option component.
packages/theme/src/option/vars.less Added new variable for unchecked icons when disabled and updated comments for clarity.
packages/theme/src/pager/vars.less Updated background color variables for active and hover states of pagination items.
packages/theme/src/popeditor/vars.less Updated icon font size variable to reference var(--tv-icon-size).
packages/theme/src/selected-box/vars.less Corrected syntax error in hover state icon color variable.

Possibly related PRs

Suggested labels

feature

Suggested reviewers

  • zzcr

🐇 In the land of style, where colors play,
A new theme is born, brightening the day.
With variables galore, for every hue,
Our UI will shine, fresh and anew!
So hop along, friends, let’s celebrate,
For a theme so lovely, we just can’t wait! 🌈


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ea30b4c and 28ba701.

📒 Files selected for processing (1)
  • packages/theme/src/base/aurora-theme.less (1 hunks)
🔇 Additional comments (3)
packages/theme/src/base/aurora-theme.less (3)

244-246: 🛠️ Refactor suggestion

Ensure consistency between variable values and comments for information colors

The values assigned to --tv-color-act-info-bg-light, --tv-color-act-info-bg-light-hover, and --tv-color-act-info-bg-light-active do not match the color codes mentioned in the comments. For example, --tv-color-act-info-bg-light is set to rgba(51,51,51,0.06), but the comment notes #f0f7ff. Please update the variable values or comments to maintain consistency and avoid confusion.

Apply this diff to correct the variable values:

- --tv-color-act-info-bg-light: rgba(51,51,51,0.06); // #f0f7ff  信息背景色-1(信息主色衍生色):朴素
+ --tv-color-act-info-bg-light: #f0f7ff; // #f0f7ff  信息背景色-1(信息主色衍生色):朴素
- --tv-color-act-info-bg-light-hover: #333; // #f0f7ff  信息hover背景色-1
+ --tv-color-act-info-bg-light-hover: #f0f7ff; // #f0f7ff  信息hover背景色-1
- --tv-color-act-info-bg-light-active:#54657e; // #f0f7ff  信息active背景色-1
+ --tv-color-act-info-bg-light-active: #f0f7ff; // #f0f7ff  信息active背景色-1

267-267: 🛠️ Refactor suggestion

Inconsistent variable value and comment for '--tv-color-text-important'

The variable --tv-color-text-important is assigned #333, but the comment mentions #191919. Please update the variable value or the comment to ensure consistency.

Apply this diff to correct the inconsistency:

- --tv-color-text-important: #333; // #191919 重要文本色-文本_金额
+ --tv-color-text-important: #191919; // #191919 重要文本色-文本_金额

276-276: 🛠️ Refactor suggestion

Inconsistent variable value and comment for '--tv-color-icon-hover'

The variable --tv-color-icon-hover is assigned #1890ff, but the comment mentions #40a9ff. Please update the variable value or the comment to ensure consistency.

Apply this diff to correct the inconsistency:

- --tv-color-icon-hover: #1890ff; // #40a9ff 图标悬浮色
+ --tv-color-icon-hover: #40a9ff; // #40a9ff 图标悬浮色

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 resolve resolve all the CodeRabbit review comments.
  • @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

github-actions bot commented Dec 3, 2024

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

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: 4

🧹 Outside diff range and nitpick comments (2)
packages/theme/src/option/index.less (1)

96-103: LGTM! Consider documenting the disabled state styling.

The changes improve the visual hierarchy of disabled options by properly handling different states (checked, unchecked, half-selected) with appropriate color variables. This enhancement provides better visual feedback to users.

Consider adding a comment block explaining the different disabled states and their corresponding color variables for better maintainability.

packages/theme/src/button/vars.less (1)

263-263: Consider standardizing the -hover-1 suffix in border color variables.

Some ghost active border colors use -hover-1 suffix while others use -hover. This inconsistency might cause confusion:

  • --tv-Button-border-color-ghost-active-success: var(--tv-color-act-success-border-hover-1)
  • --tv-Button-border-color-ghost-active-danger: var(--tv-color-act-danger-border-hover-1)

Consider standardizing these variable names for better maintainability.

Also applies to: 293-293

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 60e5402 and f95ac1a.

📒 Files selected for processing (12)
  • packages/theme/src/base/aurora-theme.less (1 hunks)
  • packages/theme/src/base/index.less (1 hunks)
  • packages/theme/src/base/old-theme.less (0 hunks)
  • packages/theme/src/base/vars.less (0 hunks)
  • packages/theme/src/breadcrumb/index.less (0 hunks)
  • packages/theme/src/button/vars.less (2 hunks)
  • packages/theme/src/calendar/vars.less (1 hunks)
  • packages/theme/src/option/index.less (1 hunks)
  • packages/theme/src/option/vars.less (1 hunks)
  • packages/theme/src/pager/vars.less (1 hunks)
  • packages/theme/src/popeditor/vars.less (1 hunks)
  • packages/theme/src/selected-box/vars.less (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/theme/src/breadcrumb/index.less
  • packages/theme/src/base/old-theme.less
  • packages/theme/src/base/vars.less
✅ Files skipped from review due to trivial changes (1)
  • packages/theme/src/base/index.less
🔇 Additional comments (5)
packages/theme/src/popeditor/vars.less (1)

23-23: Use consistent icon sizing with '--tv-icon-size'

Updating --tv-Popeditor-icon-font-size to use --tv-icon-size enhances consistency across components by standardizing icon sizes.

packages/theme/src/option/vars.less (1)

33-36: Add missing variable for unchecked disabled state

The addition of --tv-Option-icon-color-unchecked-disabled improves clarity and control over the styling of unchecked disabled option icons. The updated comments clearly distinguish between the checked and unchecked disabled states.

packages/theme/src/calendar/vars.less (1)

27-27: Standardize hover background color with theme variable

Changing --tv-Calendar-day-hover-bg to use --tv-color-bg-hover promotes consistency across components by utilizing the common hover background color defined in the theme variables.

packages/theme/src/pager/vars.less (1)

55-57: LGTM! Improved state management for pagination items.

The changes enhance visual feedback by using dedicated background colors for active and hover states, improving the consistency with the aurora theme's color system.

packages/theme/src/button/vars.less (1)

236-238: LGTM! Standardized active state styling across button themes.

The changes improve consistency by standardizing active states to use hover variants across all button themes (primary, success, warning, danger, info).

Also applies to: 242-244, 251-253, 257-259, 281-283, 287-289

--tv-color-text-placeholder: #999; // #999 占位文本色
--tv-color-text-disabled: #999; // #999 禁用文本色
--tv-color-text-active: #1890ff; // #1890ff 选中文本色 / 文本高亮色(搜索关键字高亮)
--tv-color-text-important: #333; // #191919 重要文本色-文本_金额
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Align variable value with comment for '--tv-color-text-important'

The variable --tv-color-text-important is assigned #333, but the comment mentions #191919. Please ensure that the variable value matches the color code described in the comment to prevent inconsistencies.

Apply this diff to update the variable value or comment:

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +244 to +246
--tv-color-act-info-bg-light: rgba(51,51,51,0.06); // #f0f7ff 信息背景色-1(信息主色衍生色):朴素
--tv-color-act-info-bg-light-hover: #333; // #f0f7ff 信息hover背景色-1
--tv-color-act-info-bg-light-active:#54657e; // #f0f7ff 信息active背景色-1
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ensure consistency between variable values and comments

The values assigned to --tv-color-act-info-bg-light, --tv-color-act-info-bg-light-hover, and --tv-color-act-info-bg-light-active do not match the color codes mentioned in the comments. For example, --tv-color-act-info-bg-light is set to rgba(51,51,51,0.06), but the comment notes #f0f7ff. Please update the comments or variable values to maintain consistency and avoid confusion.

Apply this diff to correct the comments:

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines 30 to 33
--tv-base-color-common-12: #2e3243;
--tv-base-color-common-12: #000000;
--tv-base-color-common-12: #d9d9d9;

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate declarations of '--tv-base-color-common-12'

The variable --tv-base-color-common-12 is declared multiple times with different values at lines 30 to 33. This can cause confusion and only the last declaration will take effect. Please consolidate these into a single definition with the intended value.

Apply this diff to remove duplicate declarations:

Committable suggestion skipped: line range outside the PR's diff.

@@ -25,7 +25,7 @@
// 图标色
--tv-SelectedBox-icon-color: var(--tv-color-icon, #808080);
// 图标悬浮色
--tv-SelectedBox-icon-color-hover: var(--tv-color-icon-hover#191919);
--tv-SelectedBox-icon-color-hover: var(--tv-color-icon-hover, #191919);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix syntax error in CSS variable fallback

The correction in --tv-SelectedBox-icon-color-hover adds the missing comma between the variable and fallback value, ensuring proper CSS variable syntax and preventing potential parsing errors.

@MomoPoppy MomoPoppy force-pushed the MomoPoppy/feat-aurora-theme branch from f95ac1a to ea30b4c Compare December 3, 2024 06:36
@MomoPoppy MomoPoppy changed the title Momo poppy/feat aurora theme feat(theme): [button] submit the initial version of aurora-theme-vars Dec 3, 2024
@github-actions github-actions bot added the enhancement New feature or request label Dec 3, 2024
@MomoPoppy
Copy link
Collaborator Author

MomoPoppy commented Dec 3, 2024

image
image

image
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


image
image
image
image

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 and nitpick comments (1)
packages/theme/src/base/aurora-theme.less (1)

142-142: Add comment for '--tv-color-act-primary-plain-text-hover'

Consider adding a descriptive comment for --tv-color-act-primary-plain-text-hover to maintain consistency and improve code readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f95ac1a and ea30b4c.

📒 Files selected for processing (12)
  • packages/theme/src/base/aurora-theme.less (1 hunks)
  • packages/theme/src/base/index.less (1 hunks)
  • packages/theme/src/base/old-theme.less (0 hunks)
  • packages/theme/src/base/vars.less (0 hunks)
  • packages/theme/src/breadcrumb/index.less (0 hunks)
  • packages/theme/src/button/vars.less (2 hunks)
  • packages/theme/src/calendar/vars.less (1 hunks)
  • packages/theme/src/option/index.less (1 hunks)
  • packages/theme/src/option/vars.less (1 hunks)
  • packages/theme/src/pager/vars.less (1 hunks)
  • packages/theme/src/popeditor/vars.less (1 hunks)
  • packages/theme/src/selected-box/vars.less (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/theme/src/breadcrumb/index.less
  • packages/theme/src/base/old-theme.less
  • packages/theme/src/base/vars.less
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/theme/src/base/index.less
  • packages/theme/src/calendar/vars.less
  • packages/theme/src/popeditor/vars.less
  • packages/theme/src/selected-box/vars.less
  • packages/theme/src/option/vars.less
  • packages/theme/src/option/index.less
  • packages/theme/src/pager/vars.less
  • packages/theme/src/button/vars.less
🔇 Additional comments (3)
packages/theme/src/base/aurora-theme.less (3)

29-32: Remove duplicate declarations of '--tv-base-color-common-12'

The variable --tv-base-color-common-12 is declared multiple times with different values from lines 29 to 32. This can cause confusion, and only the last declaration will take effect. Please consolidate these into a single definition with the intended value.


244-246: Ensure consistency between variable values and comments

The values assigned to --tv-color-act-info-bg-light, --tv-color-act-info-bg-light-hover, and --tv-color-act-info-bg-light-active do not match the color codes mentioned in the comments. For example, --tv-color-act-info-bg-light is set to rgba(51,51,51,0.06), but the comment notes #f0f7ff. Please update the comments or variable values to maintain consistency and avoid confusion.


267-267: Align variable value with comment for '--tv-color-text-important'

The variable --tv-color-text-important is assigned #333, but the comment mentions #191919. Please ensure that the variable value matches the color code described in the comment to prevent inconsistencies.


/** 2.5 图标色 **/
--tv-color-icon: #bfbfbf; // #bfbfbf 默认图标
--tv-color-icon-hover: #1890ff; // #40a9ff 图标悬浮色
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Inconsistent variable value and comment for '--tv-color-icon-hover'

The variable --tv-color-icon-hover is assigned #1890ff, but the comment mentions #40a9ff. Please update the variable value or the comment to ensure consistency.

Apply this diff to correct the inconsistency:

- --tv-color-icon-hover: #1890ff; // #40a9ff 图标悬浮色
+ --tv-color-icon-hover: #40a9ff; // #40a9ff 图标悬浮色
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
--tv-color-icon-hover: #1890ff; // #40a9ff 图标悬浮色
--tv-color-icon-hover: #40a9ff; // #40a9ff 图标悬浮色

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants