优化tag

master
yutent 2023-12-29 11:09:27 +08:00
parent 691b9633d0
commit dbc36cf233
1 changed files with 6 additions and 20 deletions

View File

@ -24,8 +24,8 @@ class Tag extends Component {
display: flex; display: flex;
align-items: center; align-items: center;
width: auto; width: auto;
height: 32px; height: var(--wc-tag-height, 32px);
padding: 0 10px; padding: var(--wc-tag-padding, 0 10px);
gap: 3px; gap: 3px;
font-size: var(--wc-tag-font, 12px); font-size: var(--wc-tag-font, 12px);
border: 1px solid var(--wc-tag-border-color, var(--color-grey-1)); border: 1px solid var(--wc-tag-border-color, var(--color-grey-1));
@ -51,24 +51,10 @@ class Tag extends Component {
`, `,
//尺寸 //尺寸
css` css`
@use 'sass:map'; :host([size='small']) {
$sizes: (
s: (
h: 20px,
p: 0 6px
),
m: (
h: 24px,
p: 0 8px
)
);
@loop $s, $v in $sizes {
:host([size='#{$s}']) {
.container { .container {
height: map.get($v, 'h'); height: 24px;
padding: map.get($v, 'p'); padding: 0 8px;
}
} }
} }
`, `,