Skip to content

Commit

Permalink
feat: add card menu styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Jun 6, 2024
1 parent d6e9da9 commit 73c201b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/scss/base/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@
}

@mixin unstyled-list {
list-style-type: none;
list-style: none;
margin: 0;
padding: 0;

ul {
list-style: none;
margin: 0;
padding: 0;
}

li li {
padding-left: $padding-block;
}
}
20 changes: 20 additions & 0 deletions src/scss/components/card/_card.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use "../../tokens/color" as *;
@use "../../tokens/font" as *;
@use "../../tokens/spacing" as *;
@use "../../base/mixins";

.iati-card {
box-shadow: 0 4px 5px $color-grey-20;
Expand Down Expand Up @@ -31,4 +32,23 @@
margin: 0;
text-transform: uppercase;
}

&__menu {
@include mixins.unstyled-list();

li,
a {
line-height: 1.2;
}

a {
text-decoration: none;
display: block;
padding: 0.6em 0;

&.current {
font-weight: $font-weight-body-strong;
}
}
}
}
23 changes: 23 additions & 0 deletions src/scss/components/card/card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,26 @@ export const Card: Story = {
</div>
`,
};

export const CardWithMenu: Story = {
render: () => html`
<div class="iati-card">
<p class="iati-card__title">Card Title</p>
<p class="iati-card__subtitle">Subtitle</p>
<ul class="iati-card__menu">
<li><a>Item 1</a></li>
<li>
<a>Item 2</a>
<ul>
<li>
<a class="current">Nested Item 1</a>
<ul>
<li><a>Nested Item 2</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
`,
};

0 comments on commit 73c201b

Please sign in to comment.