Skip to content

Conversation

shenjunjian
Copy link
Collaborator

@shenjunjian shenjunjian commented Feb 26, 2025

PR

fix(site): 修复源码复制图标的颜色
修复图标颜色
修复回到顶部的颜色
tooltip新增一个公共变量

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

    • Enhanced contributor and settings displays with dynamic, theme-based colors.
    • Streamlined tooltip behavior and visual feedback with simplified interactions and hover effects.
    • Refined demo presentation with improved container styling for consistent appearance in both light and dark modes.
  • Chores

    • Updated theme configurations by adding new color variables to boost visual consistency across tooltips and text elements.

Copy link

coderabbitai bot commented Feb 26, 2025

Walkthrough

This pull request updates various component and theme styles by replacing fixed color values and font properties with CSS variables. The changes affect the contributor’s title style, tooltip implementation in the demo, and settings icon styling, while also introducing new theme variables related to tooltip text and dark mode support. The diff simplifies tooltip logic by switching to a directive and ensures that color styling remains dynamic and consistent across components.

Changes

File Path(s) Change Summary
examples/sites/src/views/components-doc/components/contributor.vue Removed the font-weight from .cmp-contributor-title and updated its color from #191919 to var(--tv-color-text).
examples/sites/src/views/components-doc/components/demo.vue Replaced multiple <tiny-tooltip> components with a single <i> element using the v-auto-tip directive; updated import statements; modified .pc-demo-container styling and added a hover effect for icons.
examples/sites/src/views/components-doc/components/float-settings.vue Introduced a new .settings-icon class with dynamic color and fill using CSS variables; adjusted hover states, updated .style-settings-title color, and modified popover backgrounds for both light and dark themes.
packages/theme/src/base/dark-theme.less, packages/theme/src/base/vars.less Added a new CSS variable --tv-color-text-inverse-black defined from base color variables to enhance tooltip text styling.
packages/theme/src/tooltip/vars.less Updated the tooltip’s light text color variable from var(--tv-color-text-inverse-tint) to var(--tv-color-text-inverse-black).

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant I as <i> Element (with v-auto-tip)
    participant D as v-auto-tip Directive
    participant T as Tooltip Popup

    U->>I: Hover over icon
    I->>D: Trigger tooltip logic
    D->>T: Request tooltip display with content
    T-->>U: Render tooltip on screen
Loading

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • zzcr

Poem

In the land of code where pixels gleam,
A rabbit hops through every theme.
Colors shift and styles dance,
With variables enhancing every glance.
Hop along in this CSS delight,
Happy code and styles shine bright!
🐇✨

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.

examples/sites/src/views/components-doc/components/demo.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.

examples/sites/src/views/components-doc/components/contributor.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.

examples/sites/src/views/components-doc/components/float-settings.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.


📜 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 57e4a2d and 2300983.

⛔ Files ignored due to path filters (2)
  • examples/sites/src/assets/images/leftMenu/cmp-business-components.svg is excluded by !**/*.svg
  • examples/sites/src/assets/images/leftMenu/directives-custom-instruction.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • examples/sites/src/views/components-doc/components/contributor.vue (1 hunks)
  • examples/sites/src/views/components-doc/components/demo.vue (4 hunks)
  • examples/sites/src/views/components-doc/components/float-settings.vue (3 hunks)
  • packages/theme/src/base/dark-theme.less (1 hunks)
  • packages/theme/src/base/vars.less (1 hunks)
  • packages/theme/src/tooltip/vars.less (1 hunks)
🔇 Additional comments (13)
packages/theme/src/base/dark-theme.less (1)

312-312: Good addition of a dedicated CSS variable for tooltip text.

This new variable --tv-color-text-inverse-black properly references the black color from --tv-base-color-common-13 and includes a helpful comment explaining its purpose for tooltip light text. This is a good enhancement for dark mode compatibility.

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

66-66: Well-implemented variable replacement for tooltip text color.

Changing from var(--tv-color-text-inverse-tint) to the new var(--tv-color-text-inverse-black) ensures better contrast and readability for tooltip text in light mode. This change works well with the newly defined variables in both theme files.

examples/sites/src/views/components-doc/components/contributor.vue (1)

35-35: Good replacement of hardcoded color with theme variable.

Replacing the hardcoded color value with var(--tv-color-text) ensures proper dark mode adaptation. This change follows best practices for themeable components by leveraging CSS variables.

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

303-303: Excellent addition ensuring theme consistency across light and dark modes.

Adding the --tv-color-text-inverse-black variable to the light theme completes the implementation started in the dark theme. This correctly maps to var(--tv-base-color-common-11) (#191919) which is appropriate for the light theme context.

examples/sites/src/views/components-doc/components/float-settings.vue (4)

295-298: Good addition of CSS variables for icon colors

Adding CSS variables for icon colors is a good practice as it allows for consistent theming across the application and better support for dark mode.


304-305: Excellent use of theme variables for hover states

Replacing hardcoded color values with CSS variables improves theme consistency and dark mode support.


341-341: Properly implemented text color variable

Changing from hardcoded #000000 to var(--tv-color-text) ensures proper text visibility in dark mode.


364-368: Great implementation of theme-aware background colors

The implementation of background color variables for both light and dark themes ensures the popover maintains proper contrast in different modes.

examples/sites/src/views/components-doc/components/demo.vue (5)

13-35: Simplified tooltip implementation with v-auto-tip directive

Replacing multiple <tiny-tooltip> components with a more concise v-auto-tip directive implementation reduces code complexity while maintaining functionality.


75-76: Updated imports to support the new tooltip implementation

Properly updated imports to add the AutoTip directive while removing the now unused Tooltip component.


340-341: Properly handled dark mode border styling

Setting the border to none in dark mode prevents potential contrast issues with the dark background.


346-349: Improved demo container styling

The demo container now has a clearer visual distinction with explicit background and border styles, improving readability.


378-384: Enhanced icon hover interactions

Added hover effects for the icon elements improves user experience by providing visual feedback on interactive elements.


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 generate docstrings to generate docstrings for this 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.

@github-actions github-actions bot added the bug Something isn't working label Feb 26, 2025
Copy link

Walkthrough

此PR主要更新了网站的样式以适应暗模式。具体包括修复源码复制图标的颜色、回到顶部按钮的颜色,并为tooltip新增了一个公共变量。这些更改旨在改善用户在暗模式下的视觉体验。

Changes

文件 概要
examples/sites/src/assets/images/leftMenu/*.svg 更新了SVG文件以适应暗模式。
examples/sites/src/views/components-doc/components/contributor.vue 修改了文本颜色以使用CSS变量。
examples/sites/src/views/components-doc/components/demo.vue 替换了tooltip组件,使用新的指令来处理提示信息。
examples/sites/src/views/components-doc/components/float-settings.vue 更新了设置图标的颜色以使用CSS变量。
packages/theme/src/base/dark-theme.less 新增了一个CSS变量用于tooltip的light文字。
packages/theme/src/base/vars.less 新增了一个CSS变量用于tooltip的light文字。
packages/theme/src/tooltip/vars.less 修改了tooltip的文本颜色变量。

<i class="i-ti-playground ml8 h:c-success ti-w16 ti-h16 ti-cur-hand" @click="openPlayground(demo)" />
</tiny-tooltip>
<i
v-auto-tip="{ content: state.copyTip, effect: 'light', always: true }"

Choose a reason for hiding this comment

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

The v-auto-tip directive is used here to replace the previous tiny-tooltip component. Ensure that this directive is correctly implemented and tested, as it handles tooltip functionality differently.

@Issues-translate-bot
Copy link

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


Walkthrough

This PR mainly updates the style of the website to suit dark mode. Specifically, it includes fixing the color of the source code copy icon, returning to the top button color, and adding a public variable to the tooltip. These changes are designed to improve the user's visual experience in dark mode.

Changes

Documents Summary
examples/sites/src/assets/images/leftMenu/*.svg Updated SVG file to suit dark mode.
examples/sites/src/views/components-doc/components/contributor.vue Modified text color to use CSS variables.
examples/sites/src/views/components-doc/components/demo.vue Replace the tooltip component and use a new directive to handle prompt information.
examples/sites/src/views/components-doc/components/float-settings.vue Updated the color of the setting icon to use CSS variables.
packages/theme/src/base/dark-theme.less Added a CSS variable for tooltip light text.
packages/theme/src/base/vars.less Added a CSS variable for tooltip light text.
packages/theme/src/tooltip/vars.less Modified the text color variable of tooltip.

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

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.

3 participants