Skip to content

Commit

Permalink
Add grid story & fix layout
Browse files Browse the repository at this point in the history
  • Loading branch information
maxatdetroit committed Feb 14, 2024
1 parent f962e97 commit f6bd3c2
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/atoms/InfoButton/InfoButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ div {
font-family: var(--font-family);
}

.info-button-container, .info-button-container > a, .info-button-container > a > .card {
width: 100%;
height: 100%;
}

.info-btn-title {
font-weight: 900;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/atoms/InfoButton/InfoButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class InfoButton extends HTMLElement {
const shadow = this.attachShadow({ mode: 'open' });
shadow.appendChild(template.content.cloneNode(true));
this.div = document.createElement('div');
this.div.classList.add('info-button-container');
shadow.addEventListener('slotchange', (ev) => {
const tempElements = ev.target.assignedElements();
tempElements.forEach((node) => {
Expand Down
76 changes: 76 additions & 0 deletions src/stories/infobutton.stories.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { html } from 'lit-html';
import '../components/organisms/Card/cod-card';
import '../components/atoms/CardBody/cod-card-body';
import '../components/atoms/Icon/cod-icon';
Expand Down Expand Up @@ -48,3 +49,78 @@ const Template = (args) => {
};

export const Primary = Template.bind({});

export const InfoButtonGrid = () => html`
<div class="container-fluid">
<div class="row my-3">
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab"
>
</cod-info-button>
</div>
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab but this content is going to spread onto multiple lines"
>
</cod-info-button>
</div>
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab"
>
</cod-info-button>
</div>
</div>
<div class="row my-3">
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab"
>
</cod-info-button>
</div>
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab"
>
</cod-info-button>
</div>
<div class="col-sm-4">
<cod-info-button
img-src="https://placehold.co/800x400/000000/FFF"
img-alt="..."
href="https://example.com"
target="_blank"
title-primary="Some Information"
body="Commercial demolition and rehab"
>
</cod-info-button>
</div>
</div>
</div>
`;

0 comments on commit f6bd3c2

Please sign in to comment.