-
Notifications
You must be signed in to change notification settings - Fork 110
refactor: Support semantic structure #371
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
660c8ce
chore: bump react
zombieJ 917262f
chore: init
zombieJ 2181d7e
chore: classNames
zombieJ 335cd68
chore: item semantic part
zombieJ 107634a
chore: render icon
zombieJ 3911fe1
chore: next status
zombieJ 117515d
chore: line shify
zombieJ bec6338
chore: style ellipsis
zombieJ fe93120
chore: bump version
zombieJ 10ec568
chore: fix click logic
zombieJ 59b6cf0
chore: bump version to 0.0.0-alpha.1
zombieJ 8f47e58
chore: more layout
zombieJ 1d903d2
chore: bump version to 0.0.0-alpha.2
zombieJ 701e750
chore: add itemWrapperRender
zombieJ 709f517
chore: bump version to 0.0.0-alpha.3
zombieJ bc6e3c2
chore: update render logic
zombieJ 76c5882
chore: bump version to 0.0.0-alpha.4
zombieJ 1d33102
chore: link with semantic content
zombieJ 3439892
chore: bump version to 0.0.0-alpha.5
zombieJ 4f3ac5d
test: add test case
zombieJ 81f1fe8
test: add test case
zombieJ e44ed1e
chore: fix def
zombieJ 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,46 +17,34 @@ | |
| display: inline-block; | ||
| vertical-align: top; | ||
| flex: 1; | ||
| overflow: hidden; | ||
|
|
||
| &-container[role='button'] { | ||
| cursor: pointer; | ||
| transition: opacity .3s; | ||
|
|
||
| &:hover { | ||
| opacity: 0.7; | ||
| } | ||
| } | ||
| // overflow: hidden; | ||
|
|
||
| &:last-child { | ||
| flex: none; | ||
| } | ||
|
|
||
| &:last-child &-tail, | ||
| &:last-child &-title:after { | ||
| display: none; | ||
| } | ||
|
|
||
| &-container { | ||
| display: inline-block; | ||
| } | ||
|
|
||
| &-icon, | ||
| &-content { | ||
| &-section { | ||
| display: inline-block; | ||
| vertical-align: top; | ||
| } | ||
|
|
||
| &-icon { | ||
| flex: none; | ||
| border: 1px solid @wait-icon-color; | ||
| width: 26px; | ||
| height: 26px; | ||
| line-height: 26px; | ||
| text-align: center; | ||
| border-radius: 26px; | ||
| font-size: 14px; | ||
| margin-right: 8px; | ||
| transition: background-color .3s, border-color .3s; | ||
| transition: | ||
| background-color 0.3s, | ||
| border-color 0.3s; | ||
|
|
||
| > .@{stepsPrefixClass}-icon { | ||
| line-height: 1; | ||
|
|
@@ -72,49 +60,20 @@ | |
| } | ||
| } | ||
|
|
||
| &-tail { | ||
| position: absolute; | ||
| left: 0; | ||
| width: 100%; | ||
| top: 12px; | ||
| padding: 0 10px; | ||
| &:after { | ||
| content: ''; | ||
| display: inline-block; | ||
| background: @wait-tail-color; | ||
| height: 1px; | ||
| border-radius: 1px; | ||
| width: 100%; | ||
| transition: background .3s; | ||
| } | ||
| } | ||
| &-content { | ||
| &-section { | ||
| margin-top: 3px; | ||
| } | ||
| &-title { | ||
| font-size: 14px; | ||
| margin-bottom: 4px; | ||
| color: #666; | ||
| font-weight: bold; | ||
| display: inline-block; | ||
| padding-right: 10px; | ||
| position: relative; | ||
| &:after { | ||
| content: ''; | ||
| height: 1px; | ||
| width: 1000px; | ||
| background: @wait-tail-color; | ||
| display: block; | ||
| position: absolute; | ||
| top: 0.55em; | ||
| left: 100%; | ||
| } | ||
| } | ||
| &-subtitle { | ||
| font-size: 12px; | ||
| display: inline-block; | ||
| color: #999; | ||
| margin-left: 8px; | ||
| } | ||
| &-description { | ||
| font-size: 12px; | ||
|
|
@@ -138,24 +97,17 @@ | |
|
|
||
| .@{stepsPrefixClass}-horizontal:not(.@{stepsPrefixClass}-label-vertical) { | ||
| .@{stepsPrefixClass}-item { | ||
| margin-right: 10px; | ||
| &:last-child { | ||
| margin-right: 0; | ||
| } | ||
| &-tail { | ||
| display: none; | ||
| } | ||
| &-description { | ||
| max-width: @stepDescriptionMaxWidth; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .step-item-status(@status) { | ||
| @icon-color: "@{status}-icon-color"; | ||
| @title-color: "@{status}-title-color"; | ||
| @description-color: "@{status}-description-color"; | ||
| @tail-color: "@{status}-tail-color"; | ||
| @icon-color: '@{status}-icon-color'; | ||
| @title-color: '@{status}-title-color'; | ||
| @description-color: '@{status}-description-color'; | ||
| @tail-color: '@{status}-tail-color'; | ||
| &-@{status} &-icon { | ||
| border-color: @@icon-color; | ||
| background-color: #fff; | ||
|
|
@@ -168,22 +120,102 @@ | |
| } | ||
| &-@{status} &-title { | ||
| color: @@title-color; | ||
| &:after { | ||
| background-color: @@tail-color; | ||
| } | ||
| } | ||
| &-@{status} &-description { | ||
| color: @@description-color; | ||
| } | ||
| &-@{status} &-tail:after { | ||
| background-color: @@tail-color; | ||
| } | ||
|
|
||
| // @import 'custom-icon'; | ||
| // @import 'small'; | ||
| // @import 'vertical'; | ||
| // @import 'label-placement'; | ||
| // @import 'progress-dot'; | ||
| // @import 'nav'; | ||
| // @import 'inline'; | ||
|
|
||
| // ======================= Horizontal ======================= | ||
| .verticalFlex() { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .@{stepsPrefixClass} { | ||
| .@{stepsPrefixClass}-item { | ||
| &-section { | ||
| min-width: 0; | ||
| } | ||
|
|
||
| &-header { | ||
| display: flex; | ||
| gap: 8px; | ||
| align-items: center; | ||
| } | ||
|
|
||
| // Ellipsis | ||
| &-title, | ||
| &-subtitle, | ||
| &-description { | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+160
to
166
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 CSS 选择器缺失导致内容区域无样式 如需保留描述区,请补回样式或同步修改组件类名。 🤖 Prompt for AI Agents (early access) |
||
| @import 'custom-icon'; | ||
| @import 'small'; | ||
| @import 'vertical'; | ||
| @import 'label-placement'; | ||
| @import 'progress-dot'; | ||
| @import 'nav'; | ||
| @import 'inline'; | ||
| .@{stepsPrefixClass}-horizontal { | ||
| .@{stepsPrefixClass}-item { | ||
| flex: 1; | ||
| position: relative; | ||
| min-width: 0; | ||
|
|
||
| &-rail { | ||
| height: 1px; | ||
| background: @process-tail-color; | ||
| } | ||
| } | ||
|
|
||
| // Label Vertical | ||
| &.@{stepsPrefixClass}-label-vertical { | ||
| .@{stepsPrefixClass}-item { | ||
| .verticalFlex(); | ||
| padding-inline: 8px; | ||
|
|
||
| &-section { | ||
| .verticalFlex(); | ||
| } | ||
|
|
||
| &-rail { | ||
| position: absolute; | ||
| top: 13px; | ||
| left: calc(50% + 13px); | ||
| width: 100%; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Label Horizontal | ||
| &.@{stepsPrefixClass}-label-horizontal { | ||
| .@{stepsPrefixClass}-item { | ||
| display: flex; | ||
|
|
||
| &:last-child { | ||
| flex: none; | ||
| } | ||
|
|
||
| &-section { | ||
| flex: 1; | ||
| } | ||
|
|
||
| &-rail { | ||
| flex: 1; | ||
| min-width: 0; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // ======================== Vertical ======================== | ||
| .@{stepsPrefixClass}-vertical { | ||
| } | ||
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
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.
变量插值语法有误,
lessc将无法解析@@icon-color变量在 Less 中想用字符串构造另一个变量名时,需要使用
~"@{var}"才能触发插值。目前:'@{status}-icon-color'会被当成普通字符串,因此@@icon-color指向一个实际不存在的变量名,编译阶段就会报错。建议改为:
或直接省略中间变量,直接写
@@{status}-icon-color。🤖 Prompt for AI Agents (early access)