From e91b15284a4c3e019cf1ac7e4ec53bf4bba5f823 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 20 Sep 2020 11:54:41 +0530 Subject: [PATCH] css : refactor all margins * hope this does not break anything xd --- assets/css/archive.css | 3 --- assets/css/footer.css | 3 +-- assets/css/header.css | 3 +-- assets/css/main.css | 3 +-- assets/css/post-entry.css | 9 +++------ assets/css/post-single.css | 30 ++++++++++-------------------- 6 files changed, 16 insertions(+), 35 deletions(-) diff --git a/assets/css/archive.css b/assets/css/archive.css index b8e5a4bd..4470a430 100644 --- a/assets/css/archive.css +++ b/assets/css/archive.css @@ -3,9 +3,6 @@ .archive { width: 100%; text-align: left; - margin: 0 auto; - margin-top: 14px; - margin-bottom: 14px; font-size: 16px; } diff --git a/assets/css/footer.css b/assets/css/footer.css index e258999e..bf7eeeee 100644 --- a/assets/css/footer.css +++ b/assets/css/footer.css @@ -2,8 +2,7 @@ -------------------------------------------------- */ .footer { max-width: calc(var(--main-width) + var(--gap) * 2); - margin-left: auto; - margin-right: auto; + margin: auto; padding: calc((var(--footer-height) - (var(--gap)) - 10px)/ 2) var(--gap); color: var(--secondary); font-size: 12px; diff --git a/assets/css/header.css b/assets/css/header.css index 1c759f09..0263bd3e 100644 --- a/assets/css/header.css +++ b/assets/css/header.css @@ -16,8 +16,7 @@ .logo, .menu { - margin-left: var(--gap); - margin-right: var(--gap); + margin: auto var(--gap); } .logo a { diff --git a/assets/css/main.css b/assets/css/main.css index 219d52dc..64bf5629 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -4,8 +4,7 @@ position: relative; min-height: calc(100vh - var(--header-height) - var(--footer-height)); max-width: calc(var(--main-width) + var(--gap) * 2); - margin-left: auto; - margin-right: auto; + margin: auto; padding: var(--gap); } diff --git a/assets/css/post-entry.css b/assets/css/post-entry.css index 2416ef7a..55e5ba40 100644 --- a/assets/css/post-entry.css +++ b/assets/css/post-entry.css @@ -6,8 +6,7 @@ flex-direction: column; justify-content: center; min-height: 320px; - margin-bottom: calc( var(--gap) * 2); - margin-top: var(--gap); + margin: var(--gap) 0 calc(var(--gap) * 2) 0; } @media screen and (max-width: 600px) { @@ -28,8 +27,7 @@ } .first-entry .entry-content { - margin-top: 14px; - margin-bottom: 14px; + margin: 14px 0; font-size: 16px; -webkit-line-clamp: 3; } @@ -61,8 +59,7 @@ } .entry-content { - margin-top: 8px; - margin-bottom: 8px; + margin: 8px 0; color: var(--secondary); font-size: 14px; line-height: 1.6; diff --git a/assets/css/post-single.css b/assets/css/post-single.css index 5fb9af07..b73b2640 100644 --- a/assets/css/post-single.css +++ b/assets/css/post-single.css @@ -1,8 +1,7 @@ /* Post single -------------------------------------------------- */ .post-header { - margin-top: 24px; - margin-bottom: var(--content-gap); + margin: 24px auto var(--content-gap) auto } .post-title { @@ -21,13 +20,11 @@ } .post-content h1 { - margin-top: 40px; - margin-bottom: 32px; + margin: 40px auto 32px auto } .post-content h2 { - margin-top: 32px; - margin-bottom: 24px; + margin: 32px auto 24px auto; } .post-content h3, @@ -36,6 +33,7 @@ .post-content h6 { margin-top: 24px; margin-bottom: 16px; + margin: 24px auto 16px auto; } .post-content h1 { @@ -67,8 +65,7 @@ } .post-content a code { - margin-left: 0; - margin-right: 0; + margin: auto 0; border-radius: 0; box-shadow: 0 -1px 0 var(--primary) inset; } @@ -138,15 +135,12 @@ } .post-content table:not(.highlighttable) td code:only-child { - margin-left: 0; - margin-right: 0; + margin: auto 0; } .post-content .highlight, .post-content pre { - margin-left: calc(var(--gap) * -1); - margin-right: calc(var(--gap) * -1); - margin-bottom: 32px; + margin: auto calc(var(--gap) * -1) 32px calc(var(--gap) * -1); background: var(--hljs-bg) !important; border-radius: var(--radius); } @@ -160,9 +154,7 @@ } .post-content .highlight pre { - margin-left: 0; - margin-right: 0; - margin-bottom: 0; + margin: 0; } /* table */ @@ -193,8 +185,7 @@ } .post-content code { - margin-left: 4px; - margin-right: 4px; + margin: auto 4px; padding: 4px 6px; font-family: Menlo, Monaco, 'Courier New', Courier, monospace; font-size: 0.78em; @@ -205,8 +196,7 @@ .post-content pre code { display: block; - margin-left: 0; - margin-right: 0; + margin: auto 0; padding: 10px; color: rgba(255, 255, 255, 0.8); background: transparent;