Skip to content
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

style: improve button disable style #2594

Merged
merged 2 commits into from
Apr 18, 2023
Merged

Conversation

Ricbet
Copy link
Member

@Ricbet Ricbet commented Apr 17, 2023

Types

  • 💄 Style Changes

Background or solution

🤖 Generated by Copilot at 003346e

  • Refactor the style of disabled buttons to use box-shadow instead of border and set the cursor to not-allowed (link, link)

给 button 组件传递 disabled 时

before:
image
且鼠标 hover 上去没有显示禁用光标

after:
image
现在鼠标 hover 上去后会显示禁用光标

Changelog

🤖 Generated by Copilot at 003346e

Refactor button component styles for disabled and link buttons. Use box-shadow and cursor properties to enhance the appearance and usability of the button component in packages/components/src/button/style.less.

@Ricbet Ricbet self-assigned this Apr 17, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 17, 2023

ChatGPT Code Review:

CodeReview 建议:

  1. 对于 button 的样式进行了改进,处理了 disable 状态下的样式。使用了 box-shadow 来替代 border 边框,因为 border 会破坏盒模型。在使用 box-shadow 时,需要注意 box-shadow 的参数顺序,前两个为水平和垂直偏移,第三个参数为模糊参数,第四个为扩展参数。
  2. 对于 button 的几种状态,如 primary-button、secondary-button、link-button,可以添加不同的 cursor 状态,例如不可用状态下应该使用 not-allowed,而 in-progress 状态下应该使用 wait。

错误/typo 建议:

  1. 代码中应避免多余的空格。
  2. 建议添加更多的注释来解释代码中某些行的目的。
  3. 在添加不同的 cursor 状态时,应注意拼写错误,例如 not-allow 与 not-allowed,wait 与 waiter 等。

Commit Message 建议:

feat(components): improve button disable style

提供了对 button 的 disable 状态进行了改进的代码变更。添加了 box-shadow 和 cursor 状态,使得 disable 状态下的按钮更加直观。

@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (0d8b46f) 57.63% compared to head (fea7724) 57.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2594   +/-   ##
=======================================
  Coverage   57.63%   57.63%           
=======================================
  Files        1326     1326           
  Lines       83579    83579           
  Branches    17406    17406           
=======================================
  Hits        48167    48167           
  Misses      32174    32174           
  Partials     3238     3238           
Flag Coverage Δ
jsdom 52.64% <ø> (ø)
node 16.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@erha19 erha19 merged commit a2fafc6 into main Apr 18, 2023
12 checks passed
@erha19 erha19 deleted the style/improve-button-disable-style branch April 18, 2023 06:34
@erha19 erha19 added this to the 2.24 milestone Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants