Skip to content

Commit

Permalink
feat(descriptions): support nest usage (#1730)
Browse files Browse the repository at this point in the history
* feat: support nest

* feat: use mixin

* chore: fix lint

---------

Co-authored-by: wū yāng <uyarnchen@gmail.com>
  • Loading branch information
zhangpaopao0609 and uyarn authored Feb 26, 2024
1 parent 0be283e commit 16750ec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
6 changes: 5 additions & 1 deletion docs/web/api/descriptions.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ spline: layout

### Custom Style

{{ custom-style }}
{{ custom-style }}

### nest

{{ nest }}
6 changes: 5 additions & 1 deletion docs/web/api/descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ spline: layout

### 自定义样式

{{ custom-style }}
{{ custom-style }}

### 嵌套使用

{{ nest }}
28 changes: 9 additions & 19 deletions style/web/components/descriptions/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,21 @@
border-collapse: collapse;
font: @font-body-medium;

&.@{prefix}-size-l {
td {
padding: @descriptions-padding-l;
}
}

&.@{prefix}-size-m {
td {
padding: @descriptions-padding-m;
}
}

&.@{prefix}-size-s {
td {
padding: @descriptions-padding-s;
}
}
.generate-padding(l, @descriptions-padding-l);
.generate-padding(m, @descriptions-padding-m);
.generate-padding(s, @descriptions-padding-s);

& .@{prefix}-@{componentName}__label {
color: @text-color-placeholder;
}

&--border {
td {
border: @descriptions-td-border;
> tbody {
> tr {
> td {
border: @descriptions-td-border;
}
}
}

.@{prefix}-@{componentName}__label {
Expand Down
11 changes: 11 additions & 0 deletions style/web/components/descriptions/_mixin.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.generate-padding(@size, @padding) {
&.@{prefix}-size-@{size} {
> tbody {
> tr {
> td {
padding: @padding;
}
}
}
}
}

0 comments on commit 16750ec

Please sign in to comment.