Skip to content

Commit

Permalink
feat(desc): add multi paragraph support for <SDescText>
Browse files Browse the repository at this point in the history
  • Loading branch information
kiaking committed Aug 8, 2023
1 parent 823772e commit c8264cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/components/desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ The `<SDescText>` has builtin styling support for links. You may make part of th
</SDesc>
```

You may also pass in multiple paragraphs as a content. This is useful when you want to display markdown content as a value.

```vue-html
<SDesc cols="2" gap="24">
<SDescItem span="1">
<SDescLabel>About</SDescLabel>
<SDescText>
<p>Line one...</p>
<p>Line two...</p>
</SDescText>
</SDescItem>
</SDesc>
```

When displaying long text, there might be a case where you want to trim the texts into certain length. You can do so by defining `:line-clamp`. The value is the number of lines you want to display.

```vue-html
Expand Down
4 changes: 4 additions & 0 deletions lib/components/SDescText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const lineClamp = computed(() => props.lineClamp ?? 'none')
}
}
.value :deep(p + p) {
margin-top: 12px;
}
.value :deep(a) {
color: var(--c-info-text);
transition: color 0.25s;
Expand Down

0 comments on commit c8264cc

Please sign in to comment.