Skip to content
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

feat: update design tokens for tag #116

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/less-plugin-dls/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
> ⚠️ - Breaking Changes

## 11.13.0

- Adjust tokens for tags.

- Add xs size, support 0.5px border.
Justineo marked this conversation as resolved.
Show resolved Hide resolved

## 11.12.0

- Adjust global translucent color tokens again.
Expand Down
2 changes: 1 addition & 1 deletion packages/less-plugin-dls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "less-plugin-dls",
"version": "11.12.0",
"version": "11.13.0",
"description": "Less plugin for Baidu Light DLS.",
"main": "dist/index.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/less-plugin-dls/tokens/components/tag.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
@import "../global.less";

/* Metrics */
@dls-tag-height-xs: @dls-height-unit * 5;
@dls-tag-height-s: @dls-height-unit * 6;
@dls-tag-height-m: @dls-height-unit * 7;

@dls-tag-border-radius-xs: @dls-border-radius-0;
@dls-tag-border-radius-s: @dls-border-radius-1;
@dls-tag-border-radius-m: @dls-border-radius-1;

@dls-tag-border-width: 1px;
@dls-tag-border-width-xs: 0.5px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的逻辑是这样的,如果不同的 size 尺寸可能不一样,就得把 size 都枚举一遍,这里应该要 xs, s, m 都有。不带 size 后缀的可以保留来向前兼容。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 !马上补上


@dls-tag-padding: @dls-padding-unit * 2;
@dls-tag-padding-xs: @dls-padding-unit * 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@dls-tag-prefix-icon-spacing: @dls-padding-unit * 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s, m 尺寸的有 icon 吗?间距也是这个吗?如果都没有定义的话不如直接在组件库实现里面特殊处理了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都有icon, 目前使用同样的间距

@dls-tag-content-spacing: @dls-padding-unit * 2;
@dls-tag-list-spacing: @dls-padding-unit * 1;

Expand Down