Skip to content

Commit

Permalink
Edit CSS styles for posts and about page
Browse files Browse the repository at this point in the history
Signed-off-by: Randy <randymoralesg@gmail.com>
  • Loading branch information
randymorales committed Mar 20, 2021
1 parent 41b59b8 commit a80eab3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
6 changes: 4 additions & 2 deletions components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useTranslation from '@/i18n/useTranslation'

import layoutStyles from '@/styles/layout.module.css'

export default function Layout({ children, pageTitle }) {
export default function Layout({ children, pageTitle, large }) {
const { t } = useTranslation()
const Navbar = dynamic(() => import('@/components/Navbar'))

Expand Down Expand Up @@ -47,7 +47,9 @@ export default function Layout({ children, pageTitle }) {

<Navbar />

<main className={layoutStyles.content}>{children}</main>
<main className={large ? layoutStyles.large : layoutStyles.content}>
{children}
</main>
</div>
)
}
2 changes: 1 addition & 1 deletion pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function About() {

return (
<>
<Layout pageTitle={t('about')}>
<Layout pageTitle={t('about')} large={true}>
<h1>
{t('greeting')} {Name}
</h1>
Expand Down
2 changes: 0 additions & 2 deletions styles/about.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
.container {
display: flex;
justify-content: space-between;
margin-top: 4rem;
position: relative;
width: 100%;
z-index: -1;
Expand All @@ -42,7 +41,6 @@
@media (max-width: 1024px) {
.container {
align-items: center;
display: flex;
flex-direction: column;
}

Expand Down
14 changes: 3 additions & 11 deletions styles/blog.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
display: flex;
font-size: calc(1.2em * var(--scale));
justify-content: space-between;
width: 50%;
width: 100%;
}

.postContent h2 {
Expand Down Expand Up @@ -150,10 +150,6 @@
/* ******** Media Queries ******** */

@media screen and (max-width: 1024px) {
.card {
width: 44%;
}

.cardTag {
font-size: calc(1.05em * var(--scale));
}
Expand All @@ -169,10 +165,6 @@
.cardDescription {
font-size: calc(1.1em * var(--scale));
}

.postMetadata {
width: 40%;
}
}

@media screen and (max-width: 680px) {
Expand All @@ -183,7 +175,7 @@
.card {
height: 300px;
margin: 1rem 0;
width: 85%;
width: 49%;
}

.cardImg {
Expand Down Expand Up @@ -211,7 +203,7 @@
}

.postMetadata {
width: 60%;
width: 70%;
}
}

Expand Down
13 changes: 5 additions & 8 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@

@media all and (max-width: 1920px) {
:root {
--main-width: 80%;
--main-width: 50%;
--scale: 0.95;
}
}

@media all and (max-width: 1368px) {
:root {
--main-width: 85%;
--scale: 0.90;
}
}

@media all and (max-width: 1024px) {
:root {
--main-width: 90%;
--scale: 0.85;
}
}
Expand Down Expand Up @@ -90,7 +88,7 @@ body {
color: var(--content-text-color);
font-family: var(--font-family);
font-size: calc(var(--font-size) * var(--scale));
line-height:1.6
line-height:1.75
}

h1 {
Expand Down Expand Up @@ -138,6 +136,9 @@ main {
margin: 2em 0;
}

.utterances, .utterances-frame {
position: static;
}

/* ******** Tags colors ******** */
.blog {
Expand All @@ -148,10 +149,6 @@ main {
background:#e4ffe7
}

.utterances, .utterances-frame {
position: static;
}

/* ******** CSSTransition from react-transition-group ******** */

.NavAnimation-enter {
Expand Down
9 changes: 8 additions & 1 deletion styles/layout.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.content {
.content, .large {
margin-top: calc(var(--header-height) + 2em);
}

.content {
width: var(--main-width);
}

.large {
width: 80%;
}

1 comment on commit a80eab3

@vercel
Copy link

@vercel vercel bot commented on a80eab3 Mar 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.