-
Notifications
You must be signed in to change notification settings - Fork 266
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(v14): button adaptation #2737
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.nut-button { | ||
position: relative; | ||
display: flex; | ||
display: inline-block; | ||
/* #ifdef rn harmony*/ | ||
width: 80px; | ||
/* #endif */ | ||
|
@@ -21,9 +20,9 @@ | |
text-align: center; | ||
cursor: pointer; | ||
transition: $button-transition; | ||
-webkit-appearance: none; | ||
user-select: none; | ||
touch-action: manipulation; | ||
-webkit-appearance: none; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
color: $button-default-color; | ||
background: $button-default-background-color; | ||
|
@@ -99,6 +98,23 @@ | |
padding: 0; | ||
} | ||
|
||
&-round { | ||
border-radius: $button-border-radius; | ||
|
||
&-xlarge, | ||
&-large { | ||
border-radius: $button-large-border-radius; | ||
} | ||
|
||
&-small { | ||
border-radius: $button-small-border-radius; | ||
} | ||
|
||
&-mini { | ||
border-radius: $button-mini-border-radius; | ||
} | ||
} | ||
|
||
&-default { | ||
padding: $button-default-padding; | ||
border-style: solid; | ||
|
@@ -136,6 +152,14 @@ | |
padding: $button-xlarge-padding; | ||
font-size: $button-xlarge-font-size; | ||
font-weight: $button-large-font-weight; | ||
border-radius: $radius-base; | ||
|
||
.nut-button-text { | ||
margin-left: $button-xlarge-text-icon-margin; | ||
&-right { | ||
margin-right: $button-xlarge-text-icon-margin; | ||
} | ||
} | ||
Comment on lines
+157
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修复大号按钮图标间距变量使用错误 在 large 尺寸按钮中错误使用了 xlarge 的间距变量: .nut-button-text {
margin-left: $button-xlarge-text-icon-margin; // 错误使用
&-right {
margin-right: $button-xlarge-text-icon-margin; // 错误使用
}
} 建议修复为: &-large {
// ... other styles
.nut-button-text {
- margin-left: $button-xlarge-text-icon-margin;
+ margin-left: $button-large-text-icon-margin;
&-right {
- margin-right: $button-xlarge-text-icon-margin;
+ margin-right: $button-large-text-icon-margin;
}
}
} Also applies to: 182-187 |
||
|
||
.nut-icon { | ||
font-size: $button-xlarge-font-size; | ||
|
@@ -153,6 +177,14 @@ | |
padding: $button-large-padding; | ||
font-size: $button-large-font-size; | ||
font-weight: $button-large-font-weight; | ||
border-radius: $radius-base; | ||
|
||
.nut-button-text { | ||
margin-left: $button-xlarge-text-icon-margin; | ||
&-right { | ||
margin-right: $button-xlarge-text-icon-margin; | ||
} | ||
} | ||
|
||
.nut-icon { | ||
font-size: $button-large-font-size; | ||
|
@@ -170,6 +202,7 @@ | |
height: $button-small-height; | ||
padding: $button-small-padding; | ||
font-size: $button-small-font-size; | ||
border-radius: $radius-s; | ||
|
||
.nut-icon { | ||
font-size: $button-small-font-size; | ||
|
@@ -186,6 +219,7 @@ | |
height: $button-mini-height; | ||
padding: $button-mini-padding; | ||
font-size: $button-mini-font-size; | ||
border-radius: $radius-s; | ||
|
||
.nut-icon { | ||
font-size: $button-mini-font-size; | ||
|
@@ -412,23 +446,6 @@ | |
opacity: 0.9; | ||
} | ||
|
||
&-round { | ||
border-radius: $button-border-radius; | ||
|
||
&-xlarge, | ||
&-large { | ||
border-radius: $button-large-border-radius; | ||
} | ||
|
||
&-small { | ||
border-radius: $button-small-border-radius; | ||
} | ||
|
||
&-mini { | ||
border-radius: $button-mini-border-radius; | ||
} | ||
} | ||
|
||
&-square { | ||
border-radius: $button-square-border-radius; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
建议统一边框圆角变量的使用
当前代码中边框圆角的变量使用不统一:
$radius-base
$radius-s
建议:
$button-large-radius
)Also applies to: 180-181, 205-205, 222-222