Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Added color code for card overviews
Browse files Browse the repository at this point in the history
  • Loading branch information
cnoss committed Dec 3, 2023
1 parent ae90306 commit 803ade6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/_layouts/snippets/card-overview.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ exports.render = (eleventy, data, attributes) => {
const {id} = attributes;
const {search} = attributes;
const searchParams = search.split('+');
const className = attributes.className || '';

const filteredCards = data.collections.contentCards.filter(card => {
const inOverview = card.data.inOverview || [];
Expand All @@ -28,7 +29,7 @@ exports.render = (eleventy, data, attributes) => {
});

return `
<ul id="${id}" class="content-card-overview">
<ul id="${id}" class="content-card-overview ${className}">
${cardsList.join('')}
</ul>
`;
Expand Down
7 changes: 7 additions & 0 deletions src/assets/styles/scss/components/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ ul.content-card-overview{
}
}


ul.content-card-overview.stakeholder{
.content-card-item{
border-color: var(--mi-lila);
}
}

.content-card{

&-item{
Expand Down
2 changes: 1 addition & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ bodyClass: home

<snippet type="card-overview" id="content-cards" search="home"></snippet>

<snippet type="card-overview" id="content-cards" search="home-stakeholder"></snippet>
<snippet type="card-overview" id="content-cards" search="home-stakeholder" className="stakeholder"></snippet>

0 comments on commit 803ade6

Please sign in to comment.