Skip to content

Commit

Permalink
feat(accordion-item): add css variable for meta-data custom max-inlin…
Browse files Browse the repository at this point in the history
…e-size (VIV-1951) (#1865)
  • Loading branch information
rachelbt authored Jul 29, 2024
1 parent 92ea017 commit a711d16
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions libs/components/src/lib/accordion-item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ If set, the `icon` attribute is ignored.
</vwc-accordion>
```

## CSS Variables

### Meta-data Max-inline-size

Use `--accordion-item-meta-inline-size` to set a custom inline-size to the meta-data text.

- Default: `20%`

```html preview full
<vwc-accordion
expand-mode="multi"
style="--accordion-item-meta-inline-size: 230px;"
>
<vwc-accordion-item
heading="Accordion item"
meta="meta-data with custom width"
>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</vwc-accordion-item>
</vwc-accordion>
```

## Events

<div class="table-wrapper">
Expand Down
3 changes: 2 additions & 1 deletion libs/components/src/lib/accordion-item/accordion-item.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'partials/variables' as variables;
@use '../../../../../dist/libs/tokens/scss/tokens.constants' as constants;
@use '../../../../shared/src/lib/sass/mixins/connotation/config' with (
$connotations: accent,
Expand Down Expand Up @@ -66,7 +67,7 @@

.meta {
overflow: hidden;
max-width: 20%;
max-width: var(#{variables.$accordion-item-meta-inline-size}, 20%);
flex-shrink: 0;
color: var(#{constants.$vvd-color-neutral-600});
text-align: end;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$accordion-item-meta-inline-size: --accordion-item-meta-inline-size;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a711d16

Please sign in to comment.