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