Skip to content

Commit

Permalink
✨ update mobile styles for key-indicator-collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Feb 15, 2024
1 parent 9de5b77 commit f7a1cb6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
18 changes: 9 additions & 9 deletions packages/@ourworldindata/utils/src/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1624,15 +1624,6 @@ export function traverseEnrichedBlocks(
traverseEnrichedBlocks(node, callback, spanCallback)
})
})
.with(
{ type: "key-indicator-collection" },
(keyIndicatorCollection) => {
callback(keyIndicatorCollection)
keyIndicatorCollection.blocks.forEach((node) =>
traverseEnrichedBlocks(node, callback, spanCallback)
)
}
)
.with(
{
type: "key-indicator",
Expand All @@ -1644,6 +1635,15 @@ export function traverseEnrichedBlocks(
})
}
)
.with(
{ type: "key-indicator-collection" },
(keyIndicatorCollection) => {
callback(keyIndicatorCollection)
keyIndicatorCollection.blocks.forEach((node) =>
traverseEnrichedBlocks(node, callback, spanCallback)
)
}
)
.with(
{
type: P.union(
Expand Down
10 changes: 10 additions & 0 deletions site/gdocs/components/KeyIndicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

.indicator-metadata {
margin-bottom: 16px;
@include sm-only {
display: none;
}
}

.indicator-title {
Expand Down Expand Up @@ -119,4 +122,11 @@
display: none;
}
}

.key-indicator-chart {
@include sm-only {
order: -1;
margin-bottom: 16px;
}
}
}
2 changes: 1 addition & 1 deletion site/gdocs/components/KeyIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function KeyIndicator({
</a>
</div>
<Chart
className="col-start-5 span-cols-8 span-sm-cols-12 margin-0"
className="key-indicator-chart col-start-5 span-cols-8 span-sm-cols-12 margin-0"
d={{
url: linkedChart.resolvedUrl,
type: "chart",
Expand Down
5 changes: 4 additions & 1 deletion site/gdocs/components/KeyIndicatorCollection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
border-top: 1px solid var(--border);
}

.accordion-item h3 {
.accordion-item .accordion-item__heading {
margin: 0;
@include sm-only {
display: none;
}
}

.accordion-item__button,
Expand Down
2 changes: 1 addition & 1 deletion site/gdocs/components/KeyIndicatorCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function AccordionItem({
})}
>
{/* desktop */}
<h3>
<h3 className="accordion-item__heading">
<button
id={headerId}
className="accordion-item__button"
Expand Down

0 comments on commit f7a1cb6

Please sign in to comment.