Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 481
refactor: Semantic structure re-layout#1166
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2d61d98597ecabf1e9ff94a6925f2477daf1c2573de1c5e34d954431b14de98992b22d012e64fd78b95f70fa69f9e329059e78943fe0719285b64f77f380253ca6f16f9e8a2c9a4d6d38101a4cfcc578dd04df92341a8343f538ab484c5230a18a4f1faca1f211f9825e712d1db75428c03a03eef34813f71f4c5afdf9c5cf953310ed8ae683cd06f2b14e52c91c43b8b2da8027e7b2c04db275de31413648f73d3f9873530bdebe97bce99b606279464924136220d3e81f2f5de3f3a6a8ca6ec0ca69af370a16582341742cb9ad297ee3067e86869ff55f9a250d0c8a8d598c7e2ffc6d5f76922facc4e142856541ccbcafd508bdbe51de6ff308c8File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| @select-prefix: ~'rc-select'; | ||
| @import url('./patch.less'); | ||
| * { | ||
| box-sizing: border-box; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // This is used for semantic refactoring | ||
| @import (reference) url('./index.less'); | ||
| .@{select-prefix}.@{select-prefix} { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| user-select: none; | ||
| border: 1px solid blue; | ||
Contributor 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. Contributor 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. 移除或配置化硬编码的蓝色边框。 硬编码的 应用此差异移除硬编码边框: display: inline-flex;
align-items: center;
user-select: none;
- border: 1px solid blue;
position: relative;或者使用变量: - border: 1px solid blue;+ border: @select-border-width @select-border-style @select-border-color;🤖 Prompt for AI Agents | ||
| position: relative; | ||
| // Content 部分自动占据剩余宽度 | ||
| .@{select-prefix}-content { | ||
| flex: auto; | ||
| display: flex; | ||
| align-items: center; | ||
| /* Prevent content from wrapping */ | ||
| min-width: 0; /* allow flex item to shrink */ | ||
| white-space: nowrap; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| position: relative; | ||
| } | ||
| .@{select-prefix}-input { | ||
| border: none; | ||
| background: transparent; | ||
| } | ||
| .@{select-prefix}-placeholder { | ||
| opacity: 0.5; | ||
| &::after { | ||
| content: '\00a0'; // nbsp placeholder | ||
| width: 0; | ||
| overflow: hidden; | ||
| } | ||
| } | ||
| .@{select-prefix}-content, | ||
| .@{select-prefix}-input, | ||
| .@{select-prefix}-placeholder { | ||
| padding: 0; | ||
| margin: 0; | ||
| line-height: 1.5; | ||
| font-size: 14px; | ||
| font-weight: normal; | ||
| } | ||
| // 其他部分禁止自动宽度,使用内容宽度 | ||
| .@{select-prefix}-prefix, | ||
| .@{select-prefix}-suffix, | ||
| .@{select-prefix}-clear { | ||
| flex: none; | ||
| } | ||
| .@{select-prefix}-clear { | ||
| position: absolute; | ||
| top: 0; | ||
| right: 0; | ||
| } | ||
| // ============================= Single ============================= | ||
| &-single { | ||
| .@{select-prefix}-input { | ||
| position: absolute; | ||
| inset: 0; | ||
| } | ||
| } | ||
| // ============================ Multiple ============================ | ||
| &-multiple { | ||
| .@{select-prefix}-selection-item { | ||
| background: rgba(0, 0, 0, 0.1); | ||
| border-radius: 8px; | ||
| margin-right: 4px; | ||
| } | ||
| .@{select-prefix}-input { | ||
| width: calc(var(--select-input-width, 10) * 1px); | ||
| min-width: 4px; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module.exports = { | ||
| setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'], | ||
| collectCoverage: true, | ||
| collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'], | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Using a duplicated class selector (
.@{select-prefix}.@{select-prefix}) to increase specificity can be a bit of a hack and might make the CSS harder to maintain. If this is necessary to override existing styles, please add a comment explaining why. A better long-term solution might be to refactor the base styles to avoid needing such high specificity.