Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Logo Group Object #1415

Merged
merged 12 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spotty-olives-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudfour/patterns': minor
---

Add Logo Group object.
30 changes: 30 additions & 0 deletions src/objects/logo-group/demo/logos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"alt": "Walmart",
"src": "media/client-logos/logo-walmart.svg"
},
{
"alt": "Deschutes Brewery",
"src": "media/client-logos/logo-deschutes.svg"
},
{
"alt": "Obama",
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
"src": "media/client-logos/logo-obama.svg"
},
{
"alt": "Treasure Coast Hospice",
"src": "media/client-logos/logo-treasurecoast.svg"
},
{
"alt": "Entertainment",
"src": "media/client-logos/logo-entertainment.svg"
},
{
"alt": "Hautelook",
"src": "media/client-logos/logo-hautelook.svg"
},
{
"alt": "Ceasefire Oregon",
"src": "media/client-logos/logo-ceasefire.svg"
}
]
16 changes: 16 additions & 0 deletions src/objects/logo-group/logo-group.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@use "../../compiled/tokens/scss/size";
@use '../../mixins/ms';

.o-logo-group {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 0 auto;
max-width: size.$l;
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
}

.o-logo-group > * {
margin: ms.step(3);
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a design token? Maybe size.spacing.gap.logo_group?

width: size.$width-logo-group-item;
}
13 changes: 13 additions & 0 deletions src/objects/logo-group/logo-group.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Story, Canvas, Meta } from '@storybook/addon-docs/blocks';
import defaultDemo from './logo-group.twig';
import logos from './demo/logos.json';

<Meta title="Objects/Logo Group" />

# Logo Group

Logo Group can be used to display a group of client logos. Logos break onto multiple lines depending on the available space and are vertically centered.

<Canvas>
<Story name="Default">{defaultDemo({ items: logos })}</Story>
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
</Canvas>
7 changes: 7 additions & 0 deletions src/objects/logo-group/logo-group.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="o-logo-group">
{% block content %}
{% for item in items %}
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
<img src="{{ item.src }}" alt="{{ item.alt|default('') }}">
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
{% endfor %}
{% endblock %}
</div>
6 changes: 6 additions & 0 deletions src/tokens/size/sizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ module.exports = {
comment: 'The minimum space to display a default card in a grid.',
},
},
logo_group: {
item: {
dromo77 marked this conversation as resolved.
Show resolved Hide resolved
value: '9em',
comment: 'The width of individual logos in the logo group.',
},
},
},
square: {
avatar: {
Expand Down