-
Notifications
You must be signed in to change notification settings - Fork 296
fix(TextArea&Skeleton): 增加disabled样式,调整autosize demo,删除无用样式 #2684
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
934611e
feat: tag icon
xiaoyatong 0e34d43
fix(TextArea): 增加disabled样式,调整autosize demo,删除无用样式
xiaoyatong 3c66eb1
fix(TextArea): 增加disabled样式,调整autosize demo,删除无用样式
xiaoyatong d6121cb
fix: 修改cr和 skeleton
xiaoyatong 084bc99
Merge branch 'V3.0' into fix-textarea-harmony
xiaoyatong 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 hidden or 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 hidden or 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,29 +1,8 @@ | ||
| .nut-avatar-group { | ||
| background-size: 100% 100%; | ||
| background-repeat: no-repeat; | ||
| background-position: center center; | ||
| display: inline-block; | ||
| position: relative; | ||
| flex: 0 0 auto; | ||
| } | ||
| .nut-avatar-group .nut-avatar { | ||
| border: 1px solid #fff; | ||
| } | ||
| .nut-avatar-group .nut-avatar:not(:first-of-type) { | ||
| margin-left: -8px; | ||
| } | ||
|
|
||
| [dir=rtl] .nut-avatar-group .nut-avatar:not(:first-of-type), | ||
| .nut-rtl .nut-avatar-group .nut-avatar:not(:first-of-type) { | ||
| margin-left: 0; | ||
| margin-right: -8px; | ||
| } | ||
|
|
||
| .nut-image { | ||
| display: block; | ||
| position: relative; | ||
| } | ||
| .nut-image .nut-img { | ||
| .nut-image-default { | ||
| display: block; | ||
| width: 100%; | ||
| height: 100%; | ||
|
|
@@ -32,7 +11,7 @@ | |
| border-radius: 50%; | ||
| overflow: hidden; | ||
| } | ||
| .nut-image .nut-img-loading { | ||
| .nut-image-loading { | ||
| width: 100%; | ||
| height: 100%; | ||
| position: absolute; | ||
|
|
@@ -45,7 +24,7 @@ | |
| background: #f5f6fa; | ||
| background-size: 100% 100%; | ||
| } | ||
| .nut-image .nut-img-error { | ||
| .nut-image-error { | ||
| width: 100%; | ||
| height: 100%; | ||
| position: absolute; | ||
|
|
@@ -70,81 +49,124 @@ | |
| right: 0; | ||
| } | ||
|
|
||
| .nut-avatar-group { | ||
| display: flex; | ||
| flex-direction: row; | ||
| flex: 0 0 auto; | ||
| } | ||
| .nut-avatar-group-avatar, | ||
| .nut-avatar-group .nut-avatar { | ||
| border: 1px solid #fff; | ||
| margin-left: -8px; | ||
| } | ||
| .nut-avatar-group-avatar:not(:first-of-type), | ||
| .nut-avatar-group .nut-avatar:not(:first-of-type) { | ||
| margin-left: -8px; | ||
| } | ||
|
|
||
| [dir=rtl] .nut-avatar-group .nut-avatar:not(:first-of-type), | ||
| .nut-rtl .nut-avatar-group .nut-avatar:not(:first-of-type) { | ||
| margin-left: 0; | ||
| margin-right: -8px; | ||
| } | ||
|
|
||
| .nut-avatar { | ||
| background-size: 100% 100%; | ||
| background-repeat: no-repeat; | ||
| background-position: center center; | ||
| display: inline-block; | ||
| position: relative; | ||
| flex: 0 0 auto; | ||
| text-align: center; | ||
| } | ||
| .nut-avatar .avatar-img { | ||
| position: absolute; | ||
| .nut-avatar-round { | ||
| border-radius: 999px; | ||
| overflow: hidden; | ||
| } | ||
| .nut-avatar-square { | ||
| border-radius: 5px; | ||
| } | ||
| .nut-avatar-first-child { | ||
| margin-left: 0; | ||
| margin-right: 0; | ||
| } | ||
| .nut-avatar-img { | ||
| width: 100%; | ||
| height: 100%; | ||
| top: 50%; | ||
| left: 50%; | ||
| transform: translate(-50%, -50%); | ||
| flex-shrink: 0; | ||
| background-size: 100% 100%; | ||
| background-repeat: no-repeat; | ||
| background-position: center center; | ||
| } | ||
| .nut-avatar .icon { | ||
| .nut-avatar-icon { | ||
| background-size: 100% 100%; | ||
| position: absolute; | ||
| top: 50%; | ||
| left: 50%; | ||
| transform: translate(-50%, -50%); | ||
| } | ||
| .nut-avatar .nut-icon-img { | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| .nut-avatar .text { | ||
| display: inline-block; | ||
| .nut-avatar-text { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| width: 100%; | ||
| height: 100%; | ||
| text-align: center; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| [dir=rtl] .nut-avatar .avatar-img, | ||
| .nut-rtl .nut-avatar .avatar-img { | ||
| left: auto; | ||
| right: 50%; | ||
| transform: translate(50%, -50%); | ||
| .nut-avatar-large { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| width: 60px; | ||
| height: 60px; | ||
|
Comment on lines
+110
to
115
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. 🛠️ Refactor suggestion 精简重复的样式
建议提取公共样式: .nut-avatar-common {
display: flex;
justify-content: center;
align-items: center;
}
.nut-avatar-large,
.nut-avatar-normal,
.nut-avatar-small {
@extend .nut-avatar-common; /* 如果使用预处理器 */
/* 保留各自的尺寸属性 */
}Also applies to: 138-143, 153-159 |
||
| } | ||
| [dir=rtl] .nut-avatar .icon, | ||
| .nut-rtl .nut-avatar .icon { | ||
| left: auto; | ||
| right: 50%; | ||
| transform: translate(50%, -50%); | ||
| .nut-avatar-large-img { | ||
| width: 60px; | ||
| height: 60px; | ||
| } | ||
|
|
||
| .nut-avatar-large { | ||
| .nut-avatar-large-img-image { | ||
| width: 60px; | ||
| height: 60px; | ||
| } | ||
| .nut-avatar-large-icon { | ||
| width: 60px; | ||
| height: 60px; | ||
| } | ||
| .nut-avatar-large .nut-icon-img { | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| .nut-avatar-large-text { | ||
| width: 60px; | ||
| height: 60px; | ||
| line-height: 60px; | ||
| } | ||
|
|
||
| .nut-avatar-small { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| width: 32px; | ||
| height: 32px; | ||
| } | ||
| .nut-avatar-small-img-image { | ||
| width: 32px; | ||
| height: 32px; | ||
| } | ||
| .nut-avatar-small-text { | ||
| width: 32px; | ||
| height: 32px; | ||
| line-height: 32px; | ||
| } | ||
|
|
||
| .nut-avatar-normal { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| width: 40px; | ||
| height: 40px; | ||
| line-height: 40px; | ||
| } | ||
|
|
||
| .nut-avatar-round { | ||
| border-radius: 50%; | ||
| overflow: hidden; | ||
| .nut-avatar-normal-img-image { | ||
| width: 40px; | ||
| height: 40px; | ||
| } | ||
|
|
||
| .nut-avatar-square { | ||
| border-radius: 5px; | ||
| .nut-avatar-normal .nut-icon-img { | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| .nut-avatar-normal-text { | ||
| width: 40px; | ||
| height: 40px; | ||
| } | ||
|
|
||
| .nut-skeleton { | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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
优化选择器,减少不必要的类名
.nut-avatar-first-child类可以使用:first-child伪类替代,降低HTML结构的复杂度。建议修改为: