Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css improvements for the mobile view #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/

// You can delete this file if you're not using it
import "@styles/global.css";
5 changes: 4 additions & 1 deletion src/components/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const Container = styled.div`
`;

export const Section = styled.section`
padding: 7rem 0;
padding: 1rem 0;
@media (min-width: ${props => props.theme.screen.md}) {
padding: 2rem 0;
}

${props =>
props.accent && `background-color: ${props.theme.color.black.lighter}`}
Expand Down
16 changes: 2 additions & 14 deletions src/components/sections/Gallery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import styled from 'styled-components';
import { StaticQuery, graphql } from 'gatsby';
import Img from 'gatsby-image';

Expand Down Expand Up @@ -71,7 +70,7 @@ const Gallery = () => (
<Section id="gallery">
<Container>
<h1 style={{ marginBottom: '3rem' }}>Gallery</h1>
<Grid>
<div className="gallery">
{GALLERY.map(({ name, image, url }) => {
const img = data.allFile.edges.find(
({ node }) => node.relativePath === image
Expand All @@ -84,22 +83,11 @@ const Gallery = () => (
</ExternalLink>
);
})}
</Grid>
</div>
</Container>
</Section>
)}
/>
);

const Grid = styled.div`
display: grid;
grid-template-columns: repeat(auto-fill, 200px);
grid-gap: 24px;

> a {
text-decoration: none;
color: inherit;
}
`;

export default Gallery;
2 changes: 1 addition & 1 deletion src/components/sections/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Container, Button } from '@components/global';
const Header = props => (
<header style={{ padding: '3rem 0', marginTop: '5rem' }}>
<Container>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div className="header">
<div style={{ width: 300 }}>
<Image />
</div>
Expand Down
9 changes: 5 additions & 4 deletions src/components/sections/Schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Schedule extends React.PureComponent {
return (
<Section id="schedule" accent>
<Container>
<h1 style={{ marginBottom: '4rem', textAlign: 'center' }}>
<h1 style={{ marginBottom: '2rem', textAlign: 'center' }}>
Schedule
</h1>
<Tabs num={SCHEDULE.length}>
Expand Down Expand Up @@ -121,13 +121,14 @@ class Schedule extends React.PureComponent {
}

const Tabs = styled.div`
display: grid;
grid-template-columns: ${props => `repeat(${props.num}, 200px)`};
grid-gap: 32px;
display: flex;
justify-content: center;
flex-wrap: wrap;
`;

const Tab = styled(Button)`
margin: 10px;
padding: 10px 4rem;
background-color: ${props =>
props.theme.color.blue[props.active ? 'dark' : 'regular']};

Expand Down
12 changes: 7 additions & 5 deletions src/components/sections/Sponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SPONSORS = [
const Sponsors = () => (
<Section id="sponsors">
<Container>
<h1 style={{ marginBottom: '4rem', textAlign: 'center' }}>Sponsors</h1>
<h1 style={{ marginBottom: '2rem', textAlign: 'center' }}>Sponsors</h1>
<Flex>
{SPONSORS.map(({ logo, link }) => (
<Sponsor href={link} key={link}>
Expand All @@ -49,11 +49,13 @@ const Flex = styled.div`

const Sponsor = styled(ExternalLink)`
max-width: 160px;
margin-bottom: 2rem;
margin: 1rem;

&:not(:last-child) {
margin-right: 4rem;
}
@media (min-width: ${props => props.theme.screen.md}) {
&:not(:last-child) {
margin-right: 4rem;
}
}

> svg {
width: 100%;
Expand Down
21 changes: 21 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.header{
display: flex;
align-items: center;
flex-wrap: wrap;
}

.gallery{
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
}

.gallery > a{
display:block;
text-decoration: none;
color: inherit;
max-width:340px;
width:90%;
text-align:center;
}