Skip to content

fix(theme): [skeleton,collapse] update dark theme #3219

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
Mar 28, 2025

Conversation

wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 28, 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

  • Style
    • Updated icon fill colors for improved visual consistency in collapse components.
    • Added a hover underline effect and a top border to collapse item sections, enhancing interactive feedback.
    • Adjusted the collapse item background color for a cleaner appearance.
    • Refined the skeleton item icon color to better represent a disabled state.

@wuyiping0628 wuyiping0628 added the bug Something isn't working label Mar 28, 2025
Copy link

coderabbitai bot commented Mar 28, 2025

Walkthrough

The changes update several styling rules. Two Vue component files now include a CSS property that sets the fill color of the .tiny-icon-star-o class using a CSS variable. In addition, two Less files for the collapse item and skeleton item components receive modifications: one adds a hover underline and a border-top effect, while the other two update CSS variables to change background and icon colors. No exported entities have been modified.

Changes

File(s) Change Summary
examples/sites/demos/pc/app/collapse/title.vue
examples/sites/demos/pc/app/collapse/title-composition-api.vue
Added fill: var(--tv-color-icon, #808080); to the .tiny-icon-star-o class in scoped styles.
packages/theme/src/collapse-item/index.less Added a hover underline effect on &__title__right and a border-top on &__content using --tv-CollapseItem-header-border-color.
packages/theme/src/collapse-item/vars.less Updated --tv-CollapseItem-bg-color from var(--tv-color-bg-gray-1, #fafafa) to var(--tv-color-bg-3, #ffffff).
packages/theme/src/skeleton-item/vars.less Updated --tv-SkeletonItem-image-icon-color from var(--tv-color-bg, #f5f5f5) to var(--tv-color-icon-disabled, #c2c2c2).

Possibly related PRs

  • opentiny/tiny-vue#2928: Modified the .tiny-icon-star-o class by adding a CSS fill property in a similar context.
  • opentiny/tiny-vue#2338: Introduced changes to apply a CSS variable for the fill color on the .tiny-icon-star-o class.
  • opentiny/tiny-vue#2956: Updated the styling for the .tiny-icon-star-o class in other component files with the new fill property.

Suggested labels

enhancement

Suggested reviewers

  • zzcr

Poem

I'm a bunny coder, hopping with delight,
Adding stylish fills in the deep coding night.
With borders and hovers, my code leaps anew,
Dressed in CSS colors so fresh and true.
Carrots and code, together we 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/demos/pc/app/collapse/title.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/demos/pc/app/collapse/title-composition-api.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 db24997 and a8e1ad5.

📒 Files selected for processing (5)
  • examples/sites/demos/pc/app/collapse/title-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/collapse/title.vue (1 hunks)
  • packages/theme/src/collapse-item/index.less (2 hunks)
  • packages/theme/src/collapse-item/vars.less (1 hunks)
  • packages/theme/src/skeleton-item/vars.less (1 hunks)
🔇 Additional comments (6)
examples/sites/demos/pc/app/collapse/title.vue (1)

68-68: Good use of CSS variable for theming

Using the CSS variable --tv-color-icon with a fallback color ensures proper icon coloring in both light and dark themes, aligning well with the PR's objective to update the dark theme.

examples/sites/demos/pc/app/collapse/title-composition-api.vue (1)

60-60: Appropriate style consistency between API versions

The change ensures consistent styling between the Options API and Composition API versions of the component, which is good practice for maintaining a unified appearance.

packages/theme/src/collapse-item/index.less (2)

62-64: The hover effect is a good UX improvement

Adding an underline on hover provides better visual feedback to users, indicating that the element is interactive.

Ensure that the hover effect does not conflict with any existing styles or interactions, as this could lead to unexpected behavior in the UI.


106-106: Appropriate border styling for content area

Adding a border-top to the content area improves the visual separation between the header and content sections, enhancing readability. Using the same variable as other borders (--tv-CollapseItem-header-border-color) maintains design consistency.

packages/theme/src/collapse-item/vars.less (1)

17-17: Appropriate background color variable update

Changing from --tv-color-bg-gray-1, #fafafa to --tv-color-bg-3, #ffffff aligns the component with the updated theming system. This modification ensures the collapse component respects the dark theme properly, fulfilling the PR's objective.

packages/theme/src/skeleton-item/vars.less (1)

7-7: Dark Theme Variable Update Approved.

Changing the image icon color to var(--tv-color-icon-disabled, #c2c2c2) aligns with the dark theme update and improves visual consistency. This update appears intentional and appropriate for the updated dark theme.


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.

Copy link

Walkthrough

This PR updates the dark theme for the skeleton and collapse components in the Tiny Vue project. It includes changes to CSS variables and styles to enhance the visual appearance and consistency of these components in dark mode.

Changes

Files Summary
examples/sites/demos/pc/app/collapse/title-composition-api.vue, examples/sites/demos/pc/app/collapse/title.vue Added fill property to .tiny-icon-star-o for consistent icon color.
packages/theme/src/collapse-item/index.less Added hover effect and border-top style for better UI interaction.
packages/theme/src/collapse-item/vars.less Updated background color variable for dark theme consistency.
packages/theme/src/skeleton-item/vars.less Changed image icon color variable for improved dark theme appearance.

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

🧹 Nitpick comments (1)
packages/theme/src/skeleton-item/vars.less (1)

7-7: CSS Variable Update for Dark Theme

The change updates the image icon color variable to use var(--tv-color-icon-disabled, #c2c2c2), which aligns with the dark theme requirements. Please verify that this new color integrates seamlessly with the rest of the dark theme palette and maintains adequate contrast.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between db24997 and a8e1ad5.

📒 Files selected for processing (5)
  • examples/sites/demos/pc/app/collapse/title-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/collapse/title.vue (1 hunks)
  • packages/theme/src/collapse-item/index.less (2 hunks)
  • packages/theme/src/collapse-item/vars.less (1 hunks)
  • packages/theme/src/skeleton-item/vars.less (1 hunks)
🔇 Additional comments (5)
examples/sites/demos/pc/app/collapse/title-composition-api.vue (1)

58-61: Consistent theme styling for icon

Adding the fill property using the CSS variable --tv-color-icon with a fallback to #808080 ensures the icon's color is consistent with the theming system. This is a good improvement for dark theme support.

examples/sites/demos/pc/app/collapse/title.vue (1)

66-69: Consistent theme styling for icon

The addition of the fill property using --tv-color-icon with a fallback matches the implementation in the composition API version, ensuring consistent styling across different Vue API styles. This change properly supports the dark theme requirements for the icon.

packages/theme/src/collapse-item/vars.less (1)

16-18: Updated background color variable for dark theme compatibility

Changing the background color variable from --tv-color-bg-gray-1, #fafafa to --tv-color-bg-3, #ffffff is appropriate for better dark theme support. The --tv-color-bg-3 variable likely has proper dark mode mappings in the theming system.

packages/theme/src/collapse-item/index.less (2)

61-65: Enhanced hover interaction for title elements

Adding the underline text decoration on hover for the title__right element improves user feedback and accessibility by making interactive elements more obvious. This is a good enhancement for the collapse component UI.


105-107: Improved visual separation with content border

Adding a border-top to the content element creates better visual separation between the header and content areas. Using the same color variable as other borders (--tv-CollapseItem-header-border-color) maintains consistency in the design.

@zzcr zzcr merged commit 2ebe6d7 into opentiny:dev Mar 28, 2025
24 of 29 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants