-
Notifications
You must be signed in to change notification settings - Fork 130
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
fix: stepper #746
Merged
Merged
fix: stepper #746
Changes from all commits
Commits
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
overflow: hidden; | ||
box-sizing: border-box; | ||
|
||
&-button { | ||
& &-button { | ||
width: 56 * @rpx; | ||
height: 56 * @rpx; | ||
line-height: 56 * @rpx; | ||
|
@@ -19,25 +19,25 @@ | |
background-color: @COLOR_BACKGROUND; | ||
} | ||
|
||
&-button-hover { | ||
& &-button-hover { | ||
background-color: fade(@COLOR_BLACK_CHANGE, 8%); | ||
} | ||
|
||
&-button-up { | ||
& &-button-up { | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 4 * @rpx; | ||
border-bottom-left-radius: 0; | ||
border-bottom-right-radius: 4 * @rpx; | ||
} | ||
|
||
&-button-down { | ||
& &-button-down { | ||
border-top-right-radius: 0; | ||
border-top-left-radius: 4 * @rpx; | ||
border-bottom-right-radius: 0; | ||
border-bottom-left-radius: 4 * @rpx; | ||
} | ||
|
||
&-button-disabled { | ||
& &-button-disabled { | ||
color: @COLOR_TEXT_ASSIST; | ||
} | ||
|
||
|
@@ -53,7 +53,7 @@ | |
box-sizing: border-box; | ||
background-color: @COLOR_BACKGROUND; | ||
padding: 7 *@rpx 14 *@rpx; | ||
caret-color: #1677ff; | ||
caret-color: @COLOR_BRAND1; | ||
|
||
&-disabled { | ||
opacity: 0.4; | ||
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. 这段代码实现了一个按钮组件的样式,并在不同状态下应用对应的样式。以下是一些改进和可能的风险:
风险:当前的代码片段只包含样式代码,而没有与 HTML 元素匹配。因此,我们无法确保它是否可以正常工作,而且还有其他潜在的风险,例如防止过度修饰或覆盖其他样式。 |
||
|
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.
这段代码是在一个样式文件中定义了一些按钮的样式。以下是我对代码的简要审核和建议:
第 10 行
"& &-button"
看起来略微冗长,不过从逻辑上讲,它是正确的,因为&
符号代表的是父级选择器。因此,如果要创建一个.foo-button
的按钮,在引用这个样式时,我们可以这样写:.foo { .button-styles &-button }
。所以这个代码块在语言层面上没有问题。接下来几个规则集中使用了边框半径,建议将常量 @rpx 提取到变量中,例如 "@border-radius: 4 * @rpx",然后在规则集中使用 "@border-radius"。
在第 23 和 29 行中,可以将属性排序以提高可读性。你可以按以下顺序编排:display, position, box-sizing, width, height, margin, padding, overflow, border, background-color等。
希望这些建议能对你有所帮助。