Skip to content

Commit

Permalink
feat: dimensions and vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Aug 30, 2024
1 parent 36e0de7 commit 65cdc03
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/elements/core/styles/mixins/lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,17 @@
--sbb-checkup-list-marker-icon: url('https://icons.app.sbb.ch/icons/circle-tick-medium.svg');
--sbb-checkup-list-marker-icon-color: var(--sbb-color-black);
--sbb-list-marker-vertical-gap: var(--sbb-spacing-fixed-2x);
--sbb-list-marker-dimensions: var(--sbb-size-icon-ui-small);
--sbb-list-marker-to-text-gap: var(--sbb-spacing-fixed-2x);

> li,
:is(ol, ul) {
color: var(--sbb-checkup-list-color);
}

> li::before {
content: '';
background-color: var(--sbb-checkup-list-marker-icon-color);
background-color: var(--sbb-checkup-list-color, var(--sbb-checkup-list-marker-icon-color));
mask-image: var(--sbb-checkup-list-marker-icon);
mask-repeat: no-repeat;
mask-position: center;
Expand Down
30 changes: 27 additions & 3 deletions src/storybook/styles/list/list.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const CheckupTemplate = (): TemplateResult => html`
)}
`;

const CheckupCustomColorAndIconTemplate = (): TemplateResult => html`
const CheckupCustomIconTemplate = (): TemplateResult => html`
${['xs', 's', 'm', 'l', 'xl'].map(
(textSize) => html`
<sbb-title level="5">Text size ${textSize}</sbb-title>
Expand All @@ -103,6 +103,26 @@ const CheckupCustomColorAndIconTemplate = (): TemplateResult => html`
)}
`;

const CheckupCustomColorTemplate = (): TemplateResult => html`
${['xs', 's', 'm', 'l', 'xl'].map(
(textSize) => html`
<sbb-title level="5">Text size ${textSize}</sbb-title>
<ol
class=${`sbb-checkup-list sbb-text-${textSize}`}
style="--sbb-checkup-list-color: var(--sbb-color-green);"
>
${ListContent()}
<li>
Nested list
<ol class="sbb-list">
${ListContent()}
</ol>
</li>
</ol>
`,
)}
`;

const DescriptionListTemplate = (): TemplateResult => html`
<dl class="sbb-list">
<dt>Label:</dt>
Expand Down Expand Up @@ -137,8 +157,12 @@ export const CheckupList: StoryObj = {
render: CheckupTemplate,
};

export const CheckupListCustomColorAndIcon: StoryObj = {
render: CheckupCustomColorAndIconTemplate,
export const CheckupListCustomIcon: StoryObj = {
render: CheckupCustomIconTemplate,
};

export const CheckupListCustomColor: StoryObj = {
render: CheckupCustomColorTemplate,
};

export const DescriptionList: StoryObj = {
Expand Down

0 comments on commit 65cdc03

Please sign in to comment.