Skip to content

fix: fix the error in building the official website and add the default value of the theme #3262

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

zzcr
Copy link
Member

@zzcr zzcr commented Apr 7, 2025

修复官网构建报错问题,并补充theme主题默认值

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

  • Style
    • Switched the styling language of a feature component to enhance maintainability.
    • Introduced and refined default fallback values for various UI elements—including buttons, carousel controls, dialogs, checkboxes, and tooltips—to ensure a consistent look even when primary color tokens are unavailable.
    • Updated overall theme settings across light and dark modes for improved visual consistency and robustness.

Copy link

coderabbitai bot commented Apr 7, 2025

Walkthrough

This pull request updates several styling and theming files. The Vue component’s style block’s language was changed from SCSS to LESS. Multiple theme files have been modified to include fallback values in CSS variable declarations, ensuring that default colors apply when referenced variables are undefined. Additional CSS variables related to the "no data" state have been introduced and comments have been clarified. The overall component functionality and CSS structure remain unchanged.

Changes

File(s) Change Summary
examples/sites/src/views/features.vue Changed <style lang="scss"> to <style lang="less"> without affecting functionality.
packages/theme/build/mapVar.js Added new CSS variables for "no data" states and updated comments for clarity.
packages/theme/src/{aurora-theme-index.js, dark-theme-index.js, old-theme-index.js} Replaced or reformatted full CSS strings, updating color and style definitions.
packages/theme/src/.../vars.less Introduced fallback color values in various CSS variable declarations (affecting button, carousel, checkbox, dialog-box, divider, modal, option, radio, table, tooltip).

Suggested labels

bug

Poem

I'm a rabbit with hops of cheer,
Celebrating code changes far and near,
New fallbacks keep our styles in line,
With variables set to brightly shine,
Through CSS meadows I dance with delight! 🐇✨

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/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.

examples/sites/src/views/features.vue

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 5220b07 and e56bde1.

📒 Files selected for processing (15)
  • examples/sites/src/views/features.vue (1 hunks)
  • packages/theme/build/mapVar.js (4 hunks)
  • packages/theme/src/aurora-theme-index.js (1 hunks)
  • packages/theme/src/button/vars.less (3 hunks)
  • packages/theme/src/carousel/vars.less (1 hunks)
  • packages/theme/src/checkbox/vars.less (1 hunks)
  • packages/theme/src/dark-theme-index.js (1 hunks)
  • packages/theme/src/dialog-box/vars.less (1 hunks)
  • packages/theme/src/divider/vars.less (1 hunks)
  • packages/theme/src/modal/vars.less (1 hunks)
  • packages/theme/src/old-theme-index.js (1 hunks)
  • packages/theme/src/option/vars.less (1 hunks)
  • packages/theme/src/radio/vars.less (1 hunks)
  • packages/theme/src/table/vars.less (1 hunks)
  • packages/theme/src/tooltip/vars.less (1 hunks)
🔇 Additional comments (23)
packages/theme/src/option/vars.less (1)

68-68: Enhanced Fallback for Option Icon Disabled
Adding the fallback value #ffffff to --tv-Option-icon-inverse-disabled ensures that the icon correctly falls back when --tv-color-icon-inverse is undefined, improving style robustness.

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

47-47: Robust Checked Disabled Background for Radio Button
Including the fallback #dbdbdb in --tv-Radio-inner-checked-disabled-bg-color guarantees a consistent disabled appearance even if --tv-color-bg-active-control-1 is not set.

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

47-47: Consistent Fallback for Carousel Active Button
The update adds a fallback value #595959 for --tv-Carousel-outside-button-active-bg-color, ensuring that the active state styling remains intact if the primary color variable is missing.

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

51-51: Improved Fallback for Checkbox Icon Inverse Disabled
By providing the fallback value #ffffff for --tv-Checkbox-icon-inverse-disabled, the theme becomes more resilient to undefined CSS variables, leading to a more consistent UI.

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

11-11: Enhanced Default Divider Color Fallback
The modification to include a fallback #f0f0f0 in --tv-Divider-default-color ensures that divider styling remains reliable when --tv-color-border-divider is not defined.

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

31-41: Enhance Fallback Robustness for Table Variables
The changes to the CSS custom properties in this block are well done. In particular, specifying default fallback values for the table border color (#f0f0f0), the half-check icon color (#ffffff), and the border radius (4px) increases the resilience of the styling. Please verify that these defaults align with the overall theme design.

examples/sites/src/views/features.vue (1)

170-177: SCSS to LESS Conversion Confirmed
The style block’s language has been switched from SCSS to LESS, which aligns with the broader theme update. Ensure that all component styles compile and render as expected with Less.

packages/theme/src/dialog-box/vars.less (1)

13-15: Added Fallback for Dialog Box Mask Background Color
Providing the fallback value rgba(0, 0, 0, 20%) for --tv-DialogBox-mask-bg-color is a robust enhancement that ensures the mask displays a semi-transparent black color when the intended variable is undefined. This change should help avoid unexpected styling issues.

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

123-125: Default Color for Modal Loading Icon Introduced
The update to --tv-Modal-loading-status-icon-color, now using var(--tv-color-icon-active, #191919), ensures that a default color is applied if --tv-color-icon-active is not defined. This is a sensible improvement for maintaining consistent UI feedback during loading states.

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

1-6: Reformatted Dark Theme CSS Variables
The dark theme CSS string has been reorganized, which improves readability while retaining the same variable names and values. Please double-check that the updated values and their order are consistent with the branding guidelines and overall theme requirements.

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

5-5: CSS variable fallbacks added to improve theming robustness.

The updated CSS string includes comprehensive theming variables for the Aurora theme. This change appears to be part of addressing the build error mentioned in the PR objectives by ensuring all theme variables have proper definitions.

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

5-5: CSS string updated with consistent structure across themes.

The CSS string replacement ensures the old theme has a compatible structure with other themes in the system. This helps maintain consistency in the theming system while fixing build issues.

packages/theme/src/tooltip/vars.less (3)

57-57: Default fallback value added for tooltip dark background.

Adding a fallback value of #191919 ensures the tooltip will have a proper background color even if the theme variable --tv-color-bg-dark-1 is not defined. This improves robustness and helps fix build issues.


64-64: Default fallback value added for tooltip light background.

Adding a fallback value of #ffffff ensures the tooltip will have a proper background color even if the theme variable --tv-color-bg-2 is not defined.


66-66: Default fallback value added for tooltip light text color.

Adding a fallback value of #191919 ensures the tooltip will have proper text color even if the theme variable --tv-color-text is not defined.

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

325-329: New CSS variables added for "no data" states.

Four new variables have been added to handle "no data" states in the UI, providing consistent styling for empty state components. This enhances the theming system with more specific variables for this common UI pattern.


343-343: Comment clarification for module content loading mask.

The comment has been updated to more precisely describe the purpose of the --tv-color-bg-mask-block variable as "模块内容加载蒙层" (module content loading mask) instead of just "模块加载蒙层" (module loading mask).


370-370: Comment clarification for dropdown panel/tip background.

The comment has been updated to specify that --tv-color-bg-2 is intended as the "normal background color for dropdown panel/tip" rather than just the "dropdown panel/tip background color".


386-386: New variable for dark tip background color.

Added a new variable --tv-color-bg-dark-1 to define a dark background color specifically for tips. This variable is referenced in the tooltip styling (in the tooltip/vars.less file), ensuring consistent dark mode styling.

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

345-347: Improved Fallback for Default Icon Colors

The fallback values for the default icon colors have been updated:

  • --tv-Button-color-only-icon-default now falls back to #808080
  • --tv-Button-color-only-icon-default-hover now falls back to #191919

These changes ensure that if the primary color variables (--tv-color-icon or --tv-color-icon-hover) are undefined, the button still displays consistent and expected colors.


358-362: Enhanced Fallback for Background Colors in Only Icon Variant

The background color variables for the only-icon button variant have been updated with fallback values:

  • --tv-Button-bg-color-only-icon now uses a fallback of #808080
  • --tv-Button-bg-color-only-icon-hover now uses a fallback of #191919

This improvement increases the robustness of the theming by ensuring appropriate background colors if the primary variables are missing.


366-366: Consistent Fallback for Disabled Icon Hover State

The variable --tv-Button-disabled-color-only-icon-hover now explicitly provides a fallback value of #808080. This guarantees that even in a disabled state, the icon hover color remains consistent with the overall theme.


377-377: Standardized Fallback for SVG Icon Color

The fallback for --tv-Button-color-icon-svg has been standardized to #808080. This aligns the SVG icon color with the default icon color settings, ensuring visual uniformity in mixed layout scenarios.

✨ 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 bug Something isn't working label Apr 7, 2025
Copy link

github-actions bot commented Apr 7, 2025

[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

@kagol kagol merged commit a5216a8 into dev Apr 7, 2025
11 checks passed
@kagol kagol deleted the fix-site-publish-error-0407 branch April 14, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants