-
Notifications
You must be signed in to change notification settings - Fork 278
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
refactor(badge): [badge] refactor badge theme vars #2229
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,6 @@ export default { | |
|
||
<style scoped> | ||
.tiny-link { | ||
margin-right: 8px; | ||
margin-right: 48px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,6 @@ export default { | |
|
||
<style scoped> | ||
.tiny-link { | ||
margin-right: 8px; | ||
margin-right: 48px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ export default { | |
|
||
<style scoped> | ||
.tiny-link { | ||
margin-right: 8px; | ||
margin-right: 48px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,6 @@ export default { | |
|
||
<style scoped> | ||
.tiny-link { | ||
margin-right: 8px; | ||
margin-right: 48px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ export default { | |
|
||
<style scoped> | ||
.tiny-link { | ||
margin-right: 8px; | ||
margin-right: 48px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,7 @@ export default { | |
.tiny-custom-del { | ||
margin-left: 2px; | ||
} | ||
.tiny-link { | ||
margin-right: 48px; | ||
} | ||
Comment on lines
+40
to
+42
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 Consider adjusting the margin for better flexibility. The addition of Consider using a more flexible approach:
.tiny-custom {
display: flex;
flex-direction: column;
gap: 16px; /* Adjust as needed */
}
.tiny-link {
margin-right: var(--tiny-link-margin, 16px);
} This allows for easy customization and responsiveness by adjusting the |
||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,24 +17,23 @@ | |
|
||
.@{badge-prefix-cls} { | ||
&__wrapper { | ||
.component-css-vars-badge(); | ||
.inject-Badge-vars(); | ||
} | ||
|
||
display: inline-block; | ||
min-width: var(--ti-badge-size); | ||
height: var(--ti-badge-size); | ||
line-height: var(--ti-badge-line-height); | ||
border-radius: var(--ti-badge-border-radius); | ||
padding: 0 4px; | ||
font-size: var(--ti-badge-font-size); | ||
font-weight: var(--ti-badge-font-weight); | ||
color: var(--ti-badge-text-color); | ||
background-color: var(--ti-badge-bg-color); | ||
min-width: 16px; | ||
height: 16px; | ||
line-height: 16px; | ||
border-radius: var(--tv-Badge-border-radius); | ||
padding: 0 var(--tv-Badge-horizontal-padding); | ||
font-size: var(--tv-Badge-font-size); | ||
font-weight: var(--tv-Badge-font-weight); | ||
color: var(--tv-Badge-text-color); | ||
background-color: var(--tv-Badge-bg-color); | ||
Comment on lines
+24
to
+32
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 Consider using relative units for better responsiveness. The use of fixed pixel values for |
||
vertical-align: baseline; | ||
white-space: nowrap; | ||
text-align: center; | ||
margin-left: var(--ti-badge-margin-left); | ||
border: var(--ti-badge-border) solid #FFFFFF; | ||
border: 1px solid #FFFFFF; | ||
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. Replace hardcoded border color with a CSS variable for consistency. The border color is hardcoded as Apply this diff to define and use a border color variable: + // Define the variable in vars.less
+ --tv-Badge-border-color: #FFFFFF;
// In index.less
- border: 1px solid #FFFFFF;
+ border: 1px solid var(--tv-Badge-border-color);
|
||
|
||
&:empty { | ||
display: none; | ||
|
@@ -47,39 +46,16 @@ | |
|
||
a, | ||
a:hover { | ||
color: var(--ti-badge-text-color); | ||
color: var(--tv-Badge-a-text-color); | ||
text-decoration: none; | ||
} | ||
|
||
a.badge { | ||
&:hover, | ||
&:focus { | ||
color: var(--ti-badge-link-hover-text-color); | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
a.list-group-item.active > .badge, | ||
.nav-pills > .active > a > .badge { | ||
color: var(--ti-badge-active-text-color); | ||
background-color: var(--ti-badge-active-bg-color); | ||
} | ||
|
||
.nav-pills > li > a > .badge { | ||
margin-left: 3px; | ||
} | ||
|
||
&--max { | ||
padding: 0 6px; | ||
border-radius: 10px; | ||
} | ||
|
||
&--default { | ||
width: 6px; | ||
height: 6px; | ||
min-width: auto; | ||
background-color: var(--ti-badge-bg-color); | ||
background-color: var(--tv-Badge-dot-bg-color); | ||
display: inline-block; | ||
vertical-align: top; | ||
padding: 0; | ||
|
@@ -88,22 +64,22 @@ | |
} | ||
|
||
&--primary { | ||
background-color: var(--ti-badge-primary-bg-color); | ||
background-color: var(--tv-Badge-primary-bg-color); | ||
} | ||
|
||
&--success { | ||
background-color: var(--ti-badge-success-bg-color); | ||
background-color: var(--tv-Badge-success-bg-color); | ||
} | ||
|
||
&--warning { | ||
background-color: var(--ti-badge-warning-bg-color); | ||
background-color: var(--tv-Badge-warning-bg-color); | ||
} | ||
|
||
&--danger { | ||
background-color: var(--ti-badge-danger-bg-color); | ||
background-color: var(--tv-Badge-danger-bg-color); | ||
} | ||
|
||
&--info { | ||
background-color: var(--ti-badge-info-bg-color); | ||
background-color: var(--tv-Badge-info-bg-color); | ||
} | ||
} |
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.
💡 Codebase verification
Old color value 'rgb(246, 111, 106)' still present in other test files
The color
rgb(246, 111, 106)
is still used in the following files:examples/sites/demos/pc/app/time-line/status.spec.ts
Please update these instances to align with the new design system.
🔗 Analysis chain
Approve change and verify new color value
The updated background color for the danger badge (rgb(242, 48, 48)) is consistent with the PR's refactoring objectives. This change appears to introduce a more vibrant red color.
Please confirm that this new color value aligns with the updated design system and is consistently applied across the application. You may want to run the following command to check for any other occurrences of the old color value:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
rg --type less --type typescript "rgb\(246, 111, 106\)"
Length of output: 229
Script:
Length of output: 354