Skip to content

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Mar 26, 2025

更新主题变量,更新自动生成文件

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 mobile-first mode for improved usability on mobile devices.
  • Style

    • Refined theme color schemes and variable settings for a more consistent look across light, dark, and legacy themes.
    • Integrated additional component styles for cohesive visual design.
    • Added default fallback values to enhance styling resilience.

@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2025

Walkthrough

This pull request introduces a new mobile-first functionality for the User component by adding a "mobile-first" mode and a corresponding template entry. In addition, it updates theme files by refining color variable names and CSS selector order, incorporating new variables to standardize styling across light and dark themes. An import for popup styles has been added to one less file, and fallback values have been provided to enhance the robustness of transfer component styles.

Changes

File(s) Change Summary
packages/modules.json Added a new mode "mobile-first" to the User component and introduced "UserMobileFirst" template entry with path "vue/src/user/src/mobile-first.vue".
packages/theme-saas/src/index.less Added an import statement for ./popup/index.less to integrate popup component styles.
packages/theme/build/mapVar.js, packages/theme/build/release.js Updated color variables in mapVar.js (renaming, removing, and introducing new variables) and modified the CSS replacement in release.js to also convert :host.dark to :host.
packages/theme/src/aurora-theme-index.js, packages/theme/src/dark-theme-index.js, packages/theme/src/old-theme-index.js Reordered CSS selectors from :root, :host to :host, :root with the dark and old themes also receiving new CSS variables for success, error, warning, and info backgrounds/text.
packages/theme/src/transfer/vars.less Updated several CSS custom properties by adding default fallback values to enhance styling reliability for the transfer component.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant Loader as Component Loader
    participant Repo as Template Repository (modules.json)

    App->>Loader: Request "User" component in mobile-first mode
    Loader->>Repo: Lookup available modes and template paths
    Repo-->>Loader: Return mobile-first mode and "UserMobileFirst" template path
    Loader->>App: Render "User" component using mobile-first template
Loading

Possibly related PRs

Suggested labels

chore, enhancement

Poem

I'm a bunny, hopping with code so neat,
Mobile-first dreams make my heartbeat fleet.
CSS variables hop into place with flair,
Selector orders dance in the digital air.
With each style refined and every bug chased,
I celebrate changes with a joyful, rabbit grace!
🐇🥕

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/theme/build/mapVar.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/theme/build/release.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/theme/src/aurora-theme-index.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

  • 2 others

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4960a6a and e434db4.

📒 Files selected for processing (8)
  • packages/modules.json (2 hunks)
  • packages/theme-saas/src/index.less (1 hunks)
  • packages/theme/build/mapVar.js (3 hunks)
  • packages/theme/build/release.js (1 hunks)
  • packages/theme/src/aurora-theme-index.js (1 hunks)
  • packages/theme/src/dark-theme-index.js (1 hunks)
  • packages/theme/src/old-theme-index.js (1 hunks)
  • packages/theme/src/transfer/vars.less (3 hunks)
🔇 Additional comments (17)
packages/theme-saas/src/index.less (1)

120-120: Added popup styles import

The addition of popup/index.less import expands the available styles in the theme, making popup component styles available within the saas theme.

packages/theme/build/release.js (1)

53-53: Expanded dark theme selector replacement

The CSS transformation now handles both :root.dark and :host.dark selectors, ensuring consistent application of dark theme styles across different DOM contexts.

packages/theme/src/aurora-theme-index.js (1)

5-5: Reordered CSS selectors

Changed selector order from :root,:host to :host,:root. This maintains consistency with other theme files and ensures uniform CSS specificity behavior across different DOM contexts.

packages/theme/src/dark-theme-index.js (1)

5-5: Added new theme variables and reordered selectors

The changes include:

  1. Reordered selectors from :root,:host to :host,:root for consistency with other theme files
  2. Added new semi-transparent background variables for different states:
    • --tv-color-success-bg-1:#5ba85433
    • --tv-color-error-bg-1:#d9483833
    • --tv-color-warn-bg-1:#774a1633
    • --tv-color-info-bg-1:#5291ff33

These additions provide more styling options with consistent variable naming across light and dark themes.

packages/theme/src/old-theme-index.js (1)

5-5: Changes to CSS selector order and addition of new theme variables

The CSS selector order in the theme definition has been changed from :root, :host to :host,:root. Additionally, new CSS variables have been added for consistent styling across themes (such as --tv-color-success-bg-1, --tv-color-error-bg-1, etc.).

packages/modules.json (2)

2822-2823: Added mobile-first support to User component

The User component now supports mobile-first mode in addition to PC mode, enhancing its versatility across different device types.


2897-2901: Added UserMobileFirst template entry

A new entry for the mobile-first template of the User component has been added, completing the mobile-first implementation.

packages/theme/src/transfer/vars.less (4)

63-63: Added fallback value for disabled border color

Added "#dbdbdb" as a fallback for --tv-Transfer-button-disabled-border-color, improving robustness in case the referenced variable is undefined.


111-111: Added fallback value for header border color

Added "#f0f0f0" as a fallback for --tv-Transfer-header-border-color, enhancing styling reliability.


247-247: Added fallback value for SVG color

Added "#ffffff" as a fallback for --tv-Transfer-svg-color, ensuring proper rendering in various themes.


249-249: Added fallback value for text color

Added "#ffffff" as a fallback for --tv-Transfer-text-color, improving text visibility consistency.

packages/theme/build/mapVar.js (6)

103-106: Well-structured variable naming standardization for success states.

The addition of these new variables with -1 suffix helps standardize the naming convention for color variables, making the theme system more consistent and easier to maintain, especially when supporting both light and dark themes.


112-116: Good addition of standardized error state variables.

Adding these -1 suffixed variables for error states creates a more consistent naming pattern across the theme system, which will improve maintainability and make theming support more robust.


123-126: Consistent warning state variable naming.

These new warning state variables follow the same naming pattern as the success and error variables, bringing good consistency to the theming system.


131-137: Complete set of info state variables with standardized naming.

This change adds a comprehensive set of info state variables with the new naming convention, including text, background, and border properties. This is a thorough approach that ensures all aspects of the info state styling are covered.


302-302: Good addition of inverse black text variable for tooltips.

Adding this variable improves the light theme tooltip text handling, making the theming system more comprehensive.


476-477: Formatting improvement for shadow cell variables.

The spacing adjustments make the shadow variable declarations more consistent with the rest of the codebase, improving readability.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 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.

@github-actions github-actions bot added the chore label Mar 26, 2025
@github-actions
Copy link

[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

@zzcr zzcr merged commit 1a03127 into dev Mar 26, 2025
11 checks passed
@kagol kagol deleted the update-theme-0326 branch April 14, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants