Skip to content

Commit

Permalink
Replace stack with flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mattobee committed Oct 20, 2023
1 parent 05f3999 commit 31c8e1a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/_includes/today.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="today">

<div class="container readable stack">
<div class="container readable flow">

<hgroup role="group" aria-roledescription="Heading group">
<h2>Today</h2>
Expand All @@ -22,7 +22,7 @@
{% endif %}

{% if todaysThemes.length > 0 %}
<div class="events events--list stack">
<div class="events events--list flow">
{% for event in todaysThemes %}
<article
class="event event--theme"
Expand Down Expand Up @@ -78,7 +78,7 @@
{% endif %}

{% if todaysEvents.length > 0 %}
<div class="events events--list stack">
<div class="events events--list flow">
{% for event in todaysEvents %}
<article
class="event event--{{ event.type }}"
Expand Down
28 changes: 15 additions & 13 deletions src/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ layout: layouts/base.liquid
<p>There are no upcoming events. Check back later.</p>
{% endif %}

<div class="events events--list stack">
<div class="events events--list flow">
{% for event in upcomingEvents %}
{%- if event.type == "theme" %}
<article
Expand Down Expand Up @@ -144,25 +144,27 @@ layout: layouts/base.liquid
</details>
</div>
{% if event.children %}
<div class="event__children">
<div class="event__children flow">
<!-- Display the count of children with appropriate pluralization -->
{% assign childCount = event.children | size %}
{% if childCount == 1 %}
<p>{{ childCount }} accessibility highlight:</p>
{% else %}
<p>{{ childCount }} accessibility highlights:</p>
{% endif %}
<!-- List of child events -->
<ul role="list" class="event__children-list">
{% for child in event.children %}
<li class="event__child" itemprop="event" itemscope itemtype="https://schema.org/Event">
<a href="{{ child.website }}" itemprop="name">{{ child.title }}</a>
<div class="event__dates text-muted">
<time datetime="{{ child.dateStart | isoDate }}" itemprop="startDate">{{ child.dateStart | localizeDate: "LLL z" }}</time>
</div>
</li>
{% endfor %}
</ul>
<div>
<!-- List of child events -->
<ul role="list" class="event__children-list flow">
{% for child in event.children %}
<li class="event__child" itemprop="event" itemscope itemtype="https://schema.org/Event">
<a href="{{ child.website }}" itemprop="name">{{ child.title }}</a>
<div class="event__dates text-muted">
<time datetime="{{ child.dateStart | isoDate }}" itemprop="startDate">{{ child.dateStart | localizeDate: "LLL z" }}</time>
</div>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
<!-- End .event__children -->
Expand Down
1 change: 1 addition & 0 deletions src/styles/_events.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
border-top: 1px solid #ddd;
order: 5;
padding: var(--space-s-m);
--flow-space: var(--space-3xs-2xs);
}
&__type {
background-color: var(--color-primary);
Expand Down
14 changes: 4 additions & 10 deletions src/styles/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@
border-width: 0;
}

.stack {
display: flex;
flex-direction: column;
justify-content: flex-start;
.flow > * + * {
margin-block-start: var(--flow-space, 1em);
}

.stack > * {
margin-block: 0;
}

.stack > * + * {
margin-block-start: var(--space, var(--space-s-m));
.flow-tight {
--flow-space: var(--space-3xs-2xs);
}

.bg-primary {
Expand Down

0 comments on commit 31c8e1a

Please sign in to comment.