-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat(button): [button] Adapt to dark themes #3164
Conversation
WalkthroughThis update modifies the visual styling for the Changes
Possibly related PRs
Suggested reviewers
Poem
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
examples/sites/demos/pc/app/button/ghost.vueOops! 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:
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/button/ghost-composition-api.vueOops! 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:
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. Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request updates the button component to adapt to dark themes by changing the background color of the Changes
|
@@ -15,7 +15,7 @@ import { TinyButton } from '@opentiny/vue' | |||
|
|||
<style scoped> | |||
.gray-bg { | |||
background: #fafafa; | |||
background-color: rgba(0, 0, 0, 0.2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The background color change to rgba(0, 0, 0, 0.2)
helps in adapting to dark themes, but ensure that this change does not affect readability or accessibility in the demo.
@@ -21,7 +21,7 @@ export default { | |||
|
|||
<style scoped> | |||
.gray-bg { | |||
background: #fafafa; | |||
background-color: rgba(0, 0, 0, 0.2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The background color change to rgba(0, 0, 0, 0.2)
helps in adapting to dark themes, but ensure that this change does not affect readability or accessibility in the demo.
There was a problem hiding this 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)
examples/sites/demos/pc/app/button/ghost-composition-api.vue (1)
16-20
: Maintainability Suggestion: Consider CSS VariablesTo further support theme adaptability across the project (especially if additional dark/light modes are introduced later), consider defining CSS variables for colors. This will help ensure consistency and simplify future adjustments.
examples/sites/demos/pc/app/button/ghost.vue (1)
22-26
: Accessibility & Naming ConsiderationWhile the updated
rgba(0, 0, 0, 0.2)
provides a subtle dark overlay, verify that the contrast ratio is sufficient for readability in the UI. Additionally, consider whether the class name.gray-bg
is still indicative of the actual background color, or if a more descriptive name might reduce confusion in a dark-themed environment.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/demos/pc/app/button/ghost-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/button/ghost.vue
(1 hunks)
🔇 Additional comments (2)
examples/sites/demos/pc/app/button/ghost-composition-api.vue (1)
16-20
: CSS Styling Update for Dark Theme AdaptationThe background color for the
.gray-bg
class is successfully updated to usergba(0, 0, 0, 0.2)
, which aligns with the dark theme objective. The change is concise and correctly scoped.examples/sites/demos/pc/app/button/ghost.vue (1)
22-26
: Consistent Dark Theme StylingThe
.gray-bg
class in this file is updated in the same way, ensuring a consistent dark theme appearance between components. The change meets the PR objectives.
feat(button): [button] Adapt to dark themes