Skip to content

Fix toggle buttons on mobile screens #76

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

Merged
merged 3 commits into from
May 16, 2019
Merged
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
36 changes: 34 additions & 2 deletions __tests__/components/__snapshots__/Header.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ exports[`<Header /> component renders with DARK theme 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c5 svg,
Expand Down Expand Up @@ -89,6 +90,8 @@ exports[`<Header /> component renders with DARK theme 1`] = `
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
margin: 1rem 0;
width: 100%;
}

.c3 {
Expand Down Expand Up @@ -125,6 +128,12 @@ exports[`<Header /> component renders with DARK theme 1`] = `
color: #FFFFFF;
}

@media (min-width:769px) {
.c5 {
margin: 0 0 0 1.5rem;
}
}

@media (min-width:769px) {
.c0 {
-webkit-box-pack: justify;
Expand All @@ -134,6 +143,13 @@ exports[`<Header /> component renders with DARK theme 1`] = `
}
}

@media (min-width:541px) {
.c4 {
margin: 0;
width: auto;
}
}

<div>
<header
className="c0"
Expand Down Expand Up @@ -240,9 +256,10 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c5 svg,
Expand Down Expand Up @@ -322,6 +339,8 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
margin: 1rem 0;
width: 100%;
}

.c3 {
Expand Down Expand Up @@ -358,6 +377,12 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
color: #EDB8ED;
}

@media (min-width:769px) {
.c5 {
margin: 0 0 0 1.5rem;
}
}

@media (min-width:769px) {
.c0 {
-webkit-box-pack: justify;
Expand All @@ -367,6 +392,13 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
}
}

@media (min-width:541px) {
.c4 {
margin: 0;
width: auto;
}
}

<div>
<header
className="c0"
Expand Down
36 changes: 32 additions & 4 deletions __tests__/components/__snapshots__/Toggle.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ exports[`<Toggle /> renders JS toggle in DARK more 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c0 svg,
Expand All @@ -36,6 +37,12 @@ exports[`<Toggle /> renders JS toggle in DARK more 1`] = `
fill: #F2E8F2;
}

@media (min-width:769px) {
.c0 {
margin: 0 0 0 1.5rem;
}
}

<div>
<button
className="c0"
Expand Down Expand Up @@ -74,9 +81,10 @@ exports[`<Toggle /> renders JS toggle in LIGHT more 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c0 svg,
Expand All @@ -103,6 +111,12 @@ exports[`<Toggle /> renders JS toggle in LIGHT more 1`] = `
fill: #F2E8F2;
}

@media (min-width:769px) {
.c0 {
margin: 0 0 0 1.5rem;
}
}

<div>
<button
className="c0"
Expand Down Expand Up @@ -141,9 +155,10 @@ exports[`<Toggle /> renders the MODE toggle in DARK mode 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c0 svg,
Expand All @@ -170,6 +185,12 @@ exports[`<Toggle /> renders the MODE toggle in DARK mode 1`] = `
fill: #F2E8F2;
}

@media (min-width:769px) {
.c0 {
margin: 0 0 0 1.5rem;
}
}

<div>
<button
className="c0"
Expand Down Expand Up @@ -202,9 +223,10 @@ exports[`<Toggle /> renders the MODE toggle in LIGHT mode 1`] = `
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;
}

.c0 svg,
Expand All @@ -231,6 +253,12 @@ exports[`<Toggle /> renders the MODE toggle in LIGHT mode 1`] = `
fill: #F2E8F2;
}

@media (min-width:769px) {
.c0 {
margin: 0 0 0 1.5rem;
}
}

<div>
<button
className="c0"
Expand Down
7 changes: 7 additions & 0 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ const StyledLinkContainer = styled.div`

const StyledSettingsContainer = styled.div`
display: inline-flex;
margin: 1rem 0;
width: 100%;

@media (min-width: 541px) {
margin: 0;
width: auto;
}
`;

const linkStyle = css`
Expand Down
7 changes: 6 additions & 1 deletion src/components/Toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ const StyledToggle = styled.button`
border-radius: 50%;
cursor: pointer;
height: 2.5rem;
margin: 0 0 0 1rem;
margin: 0.5rem 1.5rem 0 0;
outline: 0;
width: 2.5rem;
z-index: 10;

@media (min-width: 769px) {
margin: 0 0 0 1.5rem;
}

& svg,
& g {
Expand Down