Remove max-widths, use theme breakpoints module for consistency

This commit is contained in:
Aarni Halinen
2020-12-28 20:23:51 +02:00
parent f286f6dfba
commit 32bff36611
22 changed files with 71 additions and 59 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import React from "react";
import styled from "styled-components";
import Anchor from "@components/Anchor";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
interface AdminSidebarProps {
path: string;
@@ -13,7 +14,7 @@ const SideBar = styled.nav`
margin-right: 1rem;
background-color: ${colors.blue1};
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
margin-right: 0;
margin-bottom: 1rem;
}
@@ -37,7 +38,7 @@ const StyledLink = styled(Anchor)<{path: string}>`
border-left: 4px solid ${colors.white};
}
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
margin-bottom: 1px;
}
`;
+2 -1
View File
@@ -2,6 +2,7 @@ import React from "react";
import styled from "styled-components";
import { colors } from "@theme/colors";
import Anchor from "@components/Anchor";
import breakpoints from "@theme/breakpoints";
interface WrappedCardProps {
title: string;
@@ -45,7 +46,7 @@ const StyledCard = styled.article`
font-size: 0.9rem !important;
font-weight: 600 !important;
@media screen and (max-width: 1200px) {
@media screen and (max-width: ${breakpoints.medium}) {
margin: 0.5rem 0;
font-size: 16px;
}
+3 -2
View File
@@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import FooterContent from "./FooterContent";
const StyledFooter = styled.footer`
@@ -36,7 +37,7 @@ const CopyRight = styled.div`
}
}
@media screen and (max-width: 600px) {
@media screen and (max-width: ${breakpoints.mobile}) {
flex-flow: column nowrap;
}
`;
+3 -2
View File
@@ -1,7 +1,8 @@
import React from "react";
import styled from "styled-components";
import Anchor from "../Anchor";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
const Content = styled.div`
display: flex;
@@ -55,7 +56,7 @@ const Columns = styled.div`
const Map = styled.div`
flex: 1;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
display: none;
}
iframe {
+3 -2
View File
@@ -2,14 +2,15 @@ import React, { useState, useEffect, useRef } from "react";
import Navigation from "./Navigation";
import throttle from "lodash/throttle";
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import NavigationMobile from "./NavigationMobile";
import HeaderLogo from "./HeaderLogo";
const StyledHeader = styled.header<{isHidden?: boolean}>`
display: flex;
flex-flow: row nowrap;
@media screen and (max-width: 600px) {
@media screen and (max-width: ${breakpoints.mobile}) {
flex-flow: column nowrap;
}
`;
+3 -1
View File
@@ -2,12 +2,14 @@ import React from "react";
import styled from "styled-components";
import { Link } from "react-router-dom";
import TitleImage from "@assets/img/SIK_RGB_W_side.png";
import breakpoints from "@theme/breakpoints";
// TODO: Responsive size
const Logo = styled.img`
max-width: 300px;
margin: 1rem 1rem;
@media screen and (max-width: 600px) {
@media screen and (max-width: ${breakpoints.mobile}) {
max-width: 100% !important;
margin: 1rem 0 !important;
}
+9 -4
View File
@@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
const Container = styled.div`
display: flex;
@@ -12,17 +13,21 @@ const Container = styled.div`
min-height: 75vh;
section {
max-width: 50%;
padding: 2rem 6rem;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
max-width: unset;
padding: 1rem;
}
}
aside {
max-width: 50%;
padding: 3rem 6rem;
align-items: center;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
max-width: unset;
padding: 2rem 1rem;
}
}
@@ -31,7 +36,7 @@ const Container = styled.div`
flex: 8;
}
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
flex-direction: column;
}
-2
View File
@@ -43,8 +43,6 @@ const Aside = styled.aside<{ colors: string }>`
justify-content: center;
& > div {
max-width: 350px;
h2 {
word-break: break-word;
hyphens: auto;
@@ -9,7 +9,6 @@ interface HeroPrimarySectionProps {
const Section = styled.section`
margin: 10vh auto 0;
max-width: 800px;
text-align: center;
line-height: 1.5rem;
@@ -18,7 +17,6 @@ const Section = styled.section`
}
p {
max-width: 400px;
margin: 1em auto;
font-weight: 200;
}
+4 -3
View File
@@ -1,7 +1,8 @@
import React from "react";
import styled from "styled-components";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import Anchor from "./Anchor";
import { colors } from "@theme/colors";
interface NavbarChildLinkProps {
to: string;
@@ -14,14 +15,14 @@ const StyledLink = styled(Anchor)`
padding-right: 4rem;
font-weight: 400;
@media screen and (max-width: 1200px) {
@media screen and (max-width: ${breakpoints.medium}) {
border-bottom: 1px dotted ${colors.lightBlue};
margin-left: 2rem;
padding-left: 0;
}
&:hover {
@media screen and (min-width: 1200px) {
@media screen and (min-width: ${breakpoints.medium}) {
background-color: ${colors.lightBlue};
}
}
+3 -2
View File
@@ -2,7 +2,8 @@ import React, { useState } from "react";
import styled from "styled-components";
import DropDownBox from "./DropDownBox";
import Anchor from "./Anchor";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
const Container = styled.div`
position: relative;
@@ -28,7 +29,7 @@ const StyledLink = styled(Anchor)`
letter-spacing: 2px;
padding: 20px 0;
@media screen and (max-width: 1200px) {
@media screen and (max-width: ${breakpoints.medium}) {
border-bottom: 1px solid ${colors.lightBlue};
}
`;
+8 -7
View File
@@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import Icon, { IconType } from "./Icon";
import NavbarDropdownLink from "./NavbarDropdownLink";
import NavbarChildLink from "./NavbarChildLink";
@@ -11,7 +12,7 @@ const renderNavigationDesktopItems = () => {
<NavbarDropdownLink to="/kilta" text="Kilta ">
<NavbarChildLink to="/kilta/toiminta">Toiminta</NavbarChildLink>
<NavbarChildLink to="/kilta/fuksi">Fuksi</NavbarChildLink>
<NavbarChildLink to="/kilta/kunnia">Kunnianosoitukset</NavbarChildLink>
<NavbarChildLink to="/kilta/kunnia">Kunnianosoitukset</NavbarChildLink>
<NavbarChildLink to="https://static.sika.sik.party">Arkisto</NavbarChildLink>
</NavbarDropdownLink>
<NavbarDropdownLink to="/opinnot_ja_ura" text="Opinnot ja ura"></NavbarDropdownLink>
@@ -42,11 +43,11 @@ const Nav = styled.div`
text-decoration: none;
}
@media screen and (min-width: 600px) and (max-width: 1200px) {
@media screen and (min-width: ${breakpoints.mobile}) and (max-width: ${breakpoints.medium}) {
justify-content: flex-end;
}
@media screen and (max-width: 600px) {
@media screen and (max-width: ${breakpoints.mobile}) {
justify-content: center;
margin-left: 0;
}
@@ -58,7 +59,7 @@ const DesktopContainer = styled.div`
flex-flow: row nowrap;
justify-content: space-between;
@media screen and (max-width: 1200px) {
@media screen and (max-width: ${breakpoints.medium}) {
display: none;
}
`;
@@ -82,11 +83,11 @@ const MobileMenu = styled.div`
display: flex;
}
@media screen and (min-width: 1200px) {
@media screen and (min-width: ${breakpoints.medium}) {
display: none;
}
@media screen and (max-width: 600px) {
@media screen and (max-width: ${breakpoints.mobile}) {
margin-left: 3rem;
}
+5 -4
View File
@@ -1,5 +1,6 @@
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
const CardSection = styled.section`
@@ -11,7 +12,7 @@ const CardSection = styled.section`
flex-flow: row wrap;
padding: 2rem 1rem;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
flex-flow: column nowrap;
}
@@ -22,12 +23,12 @@ const CardSection = styled.section`
& > * {
width: calc(25% - 2rem);
@media screen and (min-width: 800px) and (max-width: 1200px) {
@media screen and (min-width: ${breakpoints.mobile}) and (max-width: ${breakpoints.medium}) {
width: calc(50% - 2rem);
margin-bottom: 2rem;
}
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
width: 100%;
margin: 0 0 3rem 0;
}
+6 -7
View File
@@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import { colors } from "@theme/colors";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
const StyledSection = styled.section`
display: grid;
@@ -15,7 +16,7 @@ const StyledSection = styled.section`
"title title title"
"leftaside content rightaside";
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
grid-template-columns: 1fr;
grid-template-rows: 1fr auto auto auto;
grid-template-areas:
@@ -42,8 +43,6 @@ const StyledSection = styled.section`
& > div, p {
grid-area: content;
max-width: 1000px;
}
& > aside {
@@ -51,7 +50,7 @@ const StyledSection = styled.section`
flex-direction: column;
justify-content: space-between;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
align-items: center;
max-width: unset;
margin-left: unset;
@@ -66,14 +65,14 @@ const StyledSection = styled.section`
& > aside:first-of-type {
grid-area: rightaside;
padding-left: 24px;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
padding-left: 0;
}
}
& > aside:nth-of-type(2) {
grid-area: leftaside;
padding-right: 24px;
@media screen and (max-width: 800px) {
@media screen and (max-width: ${breakpoints.mobile}) {
padding-left: 0;
}
}