Browse Source

fix: fix tag border style (#42619)

* fix: fix tag style

* test: update snao

* test: update snap
pull/42624/head
lijianan 2 years ago
committed by GitHub
parent
commit
03a7374aa1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap
  2. 40
      components/tag/__tests__/__snapshots__/demo.test.ts.snap
  3. 12
      components/tag/demo/borderless.tsx
  4. 3
      components/tag/style/index.ts

40
components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -316,6 +316,46 @@ Array [
class="ant-space ant-space-horizontal ant-space-align-center"
style="flex-wrap: wrap; margin-bottom: -8px;"
>
<div
class="ant-space-item"
style="margin-right: 0px; padding-bottom: 8px;"
>
<span
class="ant-tag ant-tag-processing ant-tag-borderless"
>
processing
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 0px; padding-bottom: 8px;"
>
<span
class="ant-tag ant-tag-success ant-tag-borderless"
>
success
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 0px; padding-bottom: 8px;"
>
<span
class="ant-tag ant-tag-error ant-tag-borderless"
>
error
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 0px; padding-bottom: 8px;"
>
<span
class="ant-tag ant-tag-warning ant-tag-borderless"
>
warning
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 0px; padding-bottom: 8px;"

40
components/tag/__tests__/__snapshots__/demo.test.ts.snap

@ -316,6 +316,46 @@ Array [
class="ant-space ant-space-horizontal ant-space-align-center"
style="flex-wrap:wrap;margin-bottom:-8px"
>
<div
class="ant-space-item"
style="margin-right:0;padding-bottom:8px"
>
<span
class="ant-tag ant-tag-processing ant-tag-borderless"
>
processing
</span>
</div>
<div
class="ant-space-item"
style="margin-right:0;padding-bottom:8px"
>
<span
class="ant-tag ant-tag-success ant-tag-borderless"
>
success
</span>
</div>
<div
class="ant-space-item"
style="margin-right:0;padding-bottom:8px"
>
<span
class="ant-tag ant-tag-error ant-tag-borderless"
>
error
</span>
</div>
<div
class="ant-space-item"
style="margin-right:0;padding-bottom:8px"
>
<span
class="ant-tag ant-tag-warning ant-tag-borderless"
>
warning
</span>
</div>
<div
class="ant-space-item"
style="margin-right:0;padding-bottom:8px"

12
components/tag/demo/borderless.tsx

@ -15,6 +15,18 @@ const App: React.FC = () => (
</Space>
<Divider />
<Space size={[0, 'small']} wrap>
<Tag bordered={false} color="processing">
processing
</Tag>
<Tag bordered={false} color="success">
success
</Tag>
<Tag bordered={false} color="error">
error
</Tag>
<Tag bordered={false} color="warning">
warning
</Tag>
<Tag bordered={false} color="magenta">
magenta
</Tag>

3
components/tag/style/index.ts

@ -32,6 +32,9 @@ const genTagStatusStyle = (
color: token[`color${cssVariableType}`],
background: token[`color${capitalizedCssVariableType}Bg`],
borderColor: token[`color${capitalizedCssVariableType}Border`],
[`&${token.componentCls}-borderless`]: {
borderColor: 'transparent',
},
},
};
};

Loading…
Cancel
Save