Skip to content

Commit

Permalink
normalize, global styles, add roles to major landmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Frank committed May 17, 2020
1 parent 0c3a048 commit 3640482
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from "react";
import styled from "styled-components";

const Layout = styled.footer`
const Layout = styled.footer.attrs({
role: "contentinfo",
})`
display: flex;
flex-flow: row nowrap;
justify-content: flex-start;
Expand Down
7 changes: 7 additions & 0 deletions src/components/GlobalStyles/GlobalStyles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createGlobalStyle } from "styled-components";

const GlobalStyles = createGlobalStyle`
`;

export default GlobalStyles;
1 change: 1 addition & 0 deletions src/components/GlobalStyles/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as GlobalStyles } from "./GlobalStyles";
4 changes: 3 additions & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ interface HeaderProps {
children?: React.ReactNode;
}

const Layout = styled.header`
const Layout = styled.header.attrs({
role: "banner",
})`
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
Expand Down
7 changes: 6 additions & 1 deletion src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import styled from "styled-components";
import { Normalize } from "styled-normalize";

import { Footer } from "../Footer";
import { GlobalStyles } from "../GlobalStyles";
import { Header } from "../Header";

interface LayoutProps {
children?: React.ReactNode;
}

const Main = styled.main`
const Main = styled.main.attrs({
role: "main",
})`
display: flex;
flex-flow: column nowrap;
justify-content: flex-start;
Expand All @@ -22,6 +25,8 @@ const Layout: React.FC<LayoutProps> = ({ children }: LayoutProps) => {
return (
<>
<Normalize />
<GlobalStyles />

<Header />
<Main>{children}</Main>
<Footer />
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./Footer";
export * from "./GlobalStyles";
export * from "./Header";
export * from "./Image";
export * from "./Layout";
Expand Down

0 comments on commit 3640482

Please sign in to comment.