Skip to content

Commit

Permalink
docs(guide): added list customization tip
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Jan 11, 2023
1 parent c3402f5 commit b9a4e82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"cSpell.words": [
"composables",
"defu",
"endregion",
"globby",
"nuxt",
"Vite",
Expand Down
15 changes: 15 additions & 0 deletions docs/guide/components/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ You can also use `default` slot to render your custom content if you don't want

::::

:::tip Customization
`AList` is highly customizable component. It uses CSS variables for its spacing so you can have full control over high it look. You can update this CSS variables via UnoCSS classes to change the appearance.

```vue
<template>
<AList class="[--a-list-gap:1rem]"></AList>
</template>
```

Below is available CSS variable you can override:

<<< @/../packages/preset-theme-default/src/scss/index.scss#a-list-css-vars

:::

<!-- 馃憠 Slots -->
::::card Slots

Expand Down
2 changes: 2 additions & 0 deletions packages/preset-theme-default/src/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ $body-color: hsla(var(--a-base-color), 0.68);

// 馃憠 List
// 鈩癸笍 We might not need `--a-list-gap` this if we are using just `AList`, however when we use list inside another component this will be helpful
// #region a-list-css-vars
--a-list-gap: 0rem;
--a-list-item-gap: 0.75rem;
--a-list-item-padding: 0.5rem 1rem;
--a-list-item-margin: 0rem;
--a-list-item-min-height: 2.5rem;
// #endregion a-list-css-vars

// !SECTION
}
Expand Down

0 comments on commit b9a4e82

Please sign in to comment.