Skip to content

Commit dcd4eaa

Browse files
authored
fix: styling issues for remove button inside tag (#4256)
1 parent 9fd1fda commit dcd4eaa

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed
161 Bytes
Loading
3.27 KB
Loading
18.3 KB
Loading

packages/components/src/components/tag/tag.lite.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export default function DBTag(props: DBTagProps) {
8484
data-size="small"
8585
data-no-text="true"
8686
data-variant="ghost"
87+
type="button"
8788
title={state.getRemoveButtonText()}>
8889
{state.getRemoveButtonText()}
8990
</button>

packages/components/src/components/tag/tag.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
&:has(.db-tab-remove-button) {
3535
padding-inline-end: 0;
36+
border-inline-end: 0;
3637
}
3738

3839
&:has(dbbutton):has(dbbutton:not(.db-tab-remove-button)),
@@ -229,8 +230,12 @@
229230
// overwrite to transparent
230231
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
231232
color: currentcolor;
232-
border: 0;
233233
aspect-ratio: 1 / 1;
234+
border-inline-start: 0;
235+
border-start-start-radius: 0;
236+
border-end-start-radius: 0;
237+
// stylelint-disable-next-line db-ux/use-border-color
238+
border-color: var(--db-tag-border-color);
234239
}
235240
}
236241
}

packages/components/src/styles/internal/_tag-components.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
$interactive-selectors: "label, button:not(.db-tab-remove-button), a";
88

99
@mixin get-weak($name: "adaptive", $border-color: 60, $background-color: 1) {
10-
// stylelint-disable-next-line db-ux/use-border-color
11-
border-color: var(
10+
--db-tag-border-color: var(
1211
--db-#{$name}-on-bg-basic-emphasis-#{$border-color}-default
1312
);
13+
// stylelint-disable-next-line db-ux/use-border-color
14+
border-color: var(--db-tag-border-color);
1415

1516
@include colors.set-current-colors(
1617
var(--db-#{$name}-bg-basic-level-#{$background-color}-default),
@@ -19,7 +20,9 @@ $interactive-selectors: "label, button:not(.db-tab-remove-button), a";
1920
}
2021

2122
@mixin get-strong($name: "adaptive") {
22-
border-color: var(--db-#{$name}-on-bg-basic-emphasis-70-default);
23+
--db-tag-border-color: var(--db-#{$name}-on-bg-basic-emphasis-70-default);
24+
// stylelint-disable-next-line db-ux/use-border-color
25+
border-color: var(--db-tag-border-color);
2326

2427
@include colors.set-current-colors(
2528
var(--db-#{$name}-bg-vibrant-default),

0 commit comments

Comments
 (0)