Skip to content

Commit 4c81399

Browse files
larixermerceyz
andauthored
docs: Add Ukraine support banner to Yarn website (#4190)
* Adds Ukraine support banner * Update packages/gatsby/src/components/header.js Co-authored-by: Kristoffer K. <[email protected]> * Updates scroll padding top height to account for banner Co-authored-by: Kristoffer K. <[email protected]>
1 parent a1ed236 commit 4c81399

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

packages/gatsby/src/components/header.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,44 @@ const MenuNavigation = styled.div`
159159
}
160160
`;
161161

162+
const Banner = styled.div`
163+
background-color: #5474c9;
164+
display: flex;
165+
flex: 1;
166+
align-items: center;
167+
justify-content: center;
168+
padding: 1em;
169+
170+
> :first-child {
171+
margin-right: 1em;
172+
}
173+
`;
174+
175+
const UkrainianFlag = styled.div`
176+
width: 4em;
177+
height: 3em;
178+
background-image: linear-gradient(#0066cc 50%, #ffcc00 50%);
179+
`;
180+
181+
const BannerTextContainer = styled.div`
182+
flex: 1;
183+
184+
color: white;
185+
186+
a {
187+
color: #fff;
188+
text-decoration: underline;
189+
}
190+
191+
> :first-child {
192+
margin-top: 0;
193+
}
194+
195+
> :last-child {
196+
margin-bottom: 0;
197+
}
198+
`;
199+
162200
const MenuSearchBox = styled.div`
163201
display: none;
164202
@@ -348,6 +386,17 @@ export const Header = ({children}) => {
348386
</a>
349387
</MenuSearchBox>
350388
</MenuContainer>
389+
<Banner>
390+
<UkrainianFlag />
391+
<BannerTextContainer>
392+
<p>
393+
The Yarn team stands with the people of Ukraine during this heinous assault on their freedom, their independence, and their lives.
394+
</p>
395+
<p>
396+
To support Ukraine in their time of need visit this <a href={`https://ukraine.ua/news/stand-with-ukraine/`}>page</a>.
397+
</p>
398+
</BannerTextContainer>
399+
</Banner>
351400
{children}
352401
</HeaderContainer>
353402
</>;

packages/gatsby/src/components/layout.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ body {
1111

1212
font-family: "Open Sans", sans-serif;
1313
line-height: 1.5;
14-
14+
1515
/* match banner + topbar height to avoid hiding anchor link targets below topbar */
16-
scroll-padding-top: 100px;
16+
scroll-padding-top: 196px;
1717
}
1818

1919
code {

0 commit comments

Comments
 (0)