Skip to content

Commit

Permalink
Merge pull request #2667 from owid/site-touchups
Browse files Browse the repository at this point in the history
Site touchups
  • Loading branch information
ikesau authored Sep 27, 2023
2 parents 48cb429 + 02608f6 commit 91e2c53
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion site/gdocs/AllCharts.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.article-block__all-charts {
h1.h1-semibold {
text-align: center;
margin-bottom: 40px;
}

figure[data-grapher-src] {
Expand Down
12 changes: 10 additions & 2 deletions site/gdocs/Footnotes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ENDNOTES_ID, RefDictionary } from "@ourworldindata/utils"
import React from "react"
import ArticleBlock from "./ArticleBlock.js"
import cx from "classnames"

export default function Footnotes({
definitions,
Expand All @@ -10,12 +11,19 @@ export default function Footnotes({
if (!definitions) {
return null
}

const definitionsArray = Object.values(definitions)
return (
<section className="footnote-container grid grid-cols-12-full-width col-start-1 col-end-limit">
<div className="col-start-4 span-cols-8 col-md-start-3 span-md-cols-10 col-sm-start-2 span-sm-cols-12">
<h3 id={ENDNOTES_ID}>Endnotes</h3>
<ol className="footnote-list">
{Object.values(definitions)
<ol
className={cx("footnote-list", {
"footnote-list--single-column":
definitionsArray.length === 1,
})}
>
{definitionsArray
.sort((a, b) => a.index - b.index)
.map((ref) => {
return (
Expand Down
12 changes: 8 additions & 4 deletions site/gdocs/centered-article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
}

.centered-article-container {
// !important because we never want this to be overwritten
.ref {
color: $vermillion;
text-decoration: none;
color: $vermillion !important;
text-decoration: none !important;
&:visited {
color: $vermillion;
color: $vermillion !important;
}
}
}
Expand Down Expand Up @@ -328,6 +329,9 @@ h3.article-block__heading.has-supertitle {
}
.footnote-list {
column-count: 2;
&.footnote-list--single-column {
column-count: 1;
}
column-span: none;
column-gap: 48px;
color: $blue-60;
Expand Down Expand Up @@ -498,7 +502,7 @@ h3.article-block__heading.has-supertitle {
.article-block__explorer {
// width is necessary for containerNode.getBoundingClientRect() in Grapher.renderGrapherIntoContainer
width: 100%;
margin: 24px 0 48px 0;
margin: 16px 0 48px 0;

figure {
margin: 0;
Expand Down
14 changes: 12 additions & 2 deletions site/gdocs/topic-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,22 @@
}
}

.article-block__gray-section {
// small amount of extra padding to match figma designs which is 40px total for key-insights heading
.article-block__heading + .wp-block-owid-key-insights {
margin-top: 8px;
}

.centered-article-container--topic-page .article-block__gray-section {
> h1 {
text-align: center;
// Countering the gray-section padding to make this have 32px 16px
margin-top: -16px;
margin-bottom: 16px;

// Special exception for the "Explore data on Blah" heading (which is a gdoc .article-block__heading)
// so that it's left-aligned like the rest of the topic page component headings
&[id^="explore"] {
grid-column-start: 2;
}
}

.article-block__text,
Expand Down

0 comments on commit 91e2c53

Please sign in to comment.