Skip to content

fix: [file-upload,input] Fix the icon color #3243

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 3, 2025

Conversation

discreted66
Copy link
Collaborator

@discreted66 discreted66 commented Apr 3, 2025

PR

fix:暗色主题适配

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
    • Enhanced error indicator styling by integrating dynamic theming, ensuring a consistent look across the application.
    • Introduced a new text styling option for descriptive elements on upload lists, improving readability and visual consistency.
    • Simplified the .demo-input class by removing unnecessary margin spacing between child elements.
    • Improved vertical spacing for disabled input masks and display-only mask text, enhancing overall layout and visual alignment.

Copy link

coderabbitai bot commented Apr 3, 2025

Walkthrough

This PR updates the CSS in the upload list component. The fill color for the &__icon-operationfaild class is now set using a CSS variable instead of a fixed hex code, and a new &__text-desc class with a line-height of 30px has been added. Additionally, a margin-bottom rule has been removed from the .demo-input class, and new padding properties have been introduced in the input component's LESS file. These changes enhance theming flexibility and styling consistency across the application.

Changes

File Changes Summary
packages/theme/src/upload-list/index.less Updated &__icon-operationfaild fill color from #f23030 to var(--tv-UploadList-item-fail-text-color); Added new &__text-desc with line-height: 30px.
examples/sites/demos/mobile-first/app/input/mask.vue Removed margin-bottom of 10px from all direct child elements of the .demo-input class.
packages/theme/src/input/index.less Added padding-top: 10px; to &.@{input-prefix-cls}__mask and &__mask-text selectors to improve vertical spacing.

Possibly related PRs

Suggested reviewers

  • zzcr

Poem

I'm a rabbit with a skip in my hop,
Watching code styles beautifully swap.
The icon now glows with a variable hue,
And text desc lines are crafted anew.
Hopped through CSS lands with a cheerful beat,
Celebrating updates that make our theme complete!


🪧 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 3, 2025
Copy link

Walkthrough

This PR addresses the adaptation of the dark theme by modifying the icon color in the file upload component. It changes the static color value to a CSS variable for better theme compatibility and introduces a new style for text description.

Changes

File Summary
packages/theme/src/upload-list/index.less Changed the icon color from a static value to a CSS variable and added a new style for text description.

@@ -291,12 +291,16 @@
}

&__icon-operationfaild {
fill: #f23030;
fill: var(--tv-UploadList-item-fail-text-color);

Choose a reason for hiding this comment

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

The color value for &__icon-operationfaild has been changed from a hardcoded color to a CSS variable var(--tv-UploadList-item-fail-text-color), which improves adaptability to different themes.

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/upload-list/index.less (1)

293-298: Updated Icon Color Using a CSS Variable
The fill property for the &__icon-operationfaild class is now set to var(--tv-UploadList-item-fail-text-color), which improves theme flexibility for dark mode. Please verify that this CSS variable is defined in your theme’s variables (e.g., in vars.less or custom.less). Additionally, consider providing a fallback value (e.g., var(--tv-UploadList-item-fail-text-color, #f23030)) if backward compatibility is a concern.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f28fd42 and d683d05.

📒 Files selected for processing (1)
  • packages/theme/src/upload-list/index.less (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (1)
packages/theme/src/upload-list/index.less (1)

300-302: Introduction of New Text Description Style
The new &__text-desc class setting a line-height of 30px is a clear and concise addition for improving text layout. Please ensure that the spacing aligns with the overall design guidelines and check that no conflicts occur with other text styles used in the upload list component.

@discreted66 discreted66 changed the title fix: [file-upload] Fix the icon clor fix: [file-upload,input] Fix the icon color Apr 3, 2025
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 (2)
packages/theme/src/input/index.less (2)

45-48: Improved Vertical Alignment in Disabled Mask Element
The addition of padding-top: 10px; within the .is-disabled &__inner .@{input-prefix-cls}__mask selector should help improve the vertical spacing when the input is disabled. Please verify that this change integrates smoothly with the dark theme styling and does not introduce any unexpected layout shifts in various browsers.


318-325: Enhanced Spacing in Display-Only Mode
The new padding-top: 10px; in the &__mask-text selector under the .is-display-only block improves text alignment. Ensure that this adjustment is consistently applied across different themes (including dark mode) and that it harmonizes with existing spacing rules.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d683d05 and b49d0d2.

📒 Files selected for processing (3)
  • examples/sites/demos/mobile-first/app/input/mask.vue (0 hunks)
  • packages/theme/src/input/index.less (2 hunks)
  • packages/theme/src/upload-list/index.less (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/sites/demos/mobile-first/app/input/mask.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/theme/src/upload-list/index.less
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: PR Unit Test
  • GitHub Check: PR E2E Test (pnpm test:e2e3)

@zzcr zzcr merged commit 69e350f into opentiny:dev Apr 3, 2025
13 of 15 checks passed
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