refactor; linting

This commit is contained in:
Aditya Telange 2020-07-20 19:53:30 +05:30
parent e6f516da62
commit e17e38b3ae
4 changed files with 107 additions and 11 deletions

View File

@ -28,6 +28,7 @@
--code-bg: #f5f5f5; --code-bg: #f5f5f5;
--border: #eee; --border: #eee;
} }
.dark { .dark {
--theme: #1d1e20; --theme: #1d1e20;
--entry: #2e2e33; --entry: #2e2e33;
@ -40,12 +41,15 @@
--code-bg: #37383e; --code-bg: #37383e;
--border: #5b5d67; --border: #5b5d67;
} }
.list { .list {
background: var(--code-bg); background: var(--code-bg);
} }
.dark.list { .dark.list {
background: var(--theme); background: var(--theme);
} }
/* Reset /* Reset
-------------------------------------------------- */ -------------------------------------------------- */
*, *,
@ -53,19 +57,22 @@
*::after { *::after {
box-sizing: border-box; box-sizing: border-box;
} }
html { html {
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }
body { body {
margin: 0; margin: 0;
color: var(--primary); color: var(--primary);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif; 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 18px; font-size: 18px;
line-height: 1.8; line-height: 1.8;
word-break: break-word; word-break: break-word;
background: var(--theme); background: var(--theme);
} }
article, article,
aside, aside,
figcaption, figcaption,
@ -78,6 +85,7 @@ nav,
section { section {
display: block; display: block;
} }
h1, h1,
h2, h2,
h3, h3,
@ -89,30 +97,37 @@ h6 {
color: var(--primary); color: var(--primary);
line-height: 1.2; line-height: 1.2;
} }
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
} }
strong, strong,
b { b {
font-weight: 500; font-weight: 500;
} }
ul { ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
a { a {
color: var(--primary); color: var(--primary);
text-decoration: none; text-decoration: none;
} }
figure { figure {
margin: 0; margin: 0;
} }
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
button, button,
input, input,
textarea { textarea {
@ -122,25 +137,30 @@ textarea {
border: 0; border: 0;
-webkit-appearance: none; -webkit-appearance: none;
} }
button, button,
input[type='button'], input[type='button'],
input[type='submit'] { input[type='submit'] {
cursor: pointer; cursor: pointer;
} }
input, input,
textarea { textarea {
padding: 0; padding: 0;
border: 0; border: 0;
outline: 0; outline: 0;
} }
input:-webkit-autofill, input:-webkit-autofill,
textarea:-webkit-autofill { textarea:-webkit-autofill {
box-shadow: 0 0 0 50px var(--theme) inset; box-shadow: 0 0 0 50px var(--theme) inset;
} }
img { img {
display: block; display: block;
max-width: 100%; max-width: 100%;
} }
/* Header /* Header
-------------------------------------------------- */ -------------------------------------------------- */
.nav { .nav {
@ -151,31 +171,38 @@ img {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.nav a { .nav a {
display: block; display: block;
line-height: var(--header-height); line-height: var(--header-height);
} }
.logo, .logo,
.menu { .menu {
margin-left: var(--gap); margin-left: var(--gap);
margin-right: var(--gap); margin-right: var(--gap);
} }
.logo a { .logo a {
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
} }
.menu { .menu {
display: flex; display: flex;
list-style: none; list-style: none;
word-break: keep-all; word-break: keep-all;
overflow-x: auto; overflow-x: auto;
} }
.menu li + li {
.menu li+li {
margin-left: var(--gap); margin-left: var(--gap);
} }
.menu a { .menu a {
font-size: 16px; font-size: 16px;
} }
/* Main /* Main
-------------------------------------------------- */ -------------------------------------------------- */
.main { .main {
@ -186,15 +213,19 @@ img {
margin-right: auto; margin-right: auto;
padding: var(--gap); padding: var(--gap);
} }
.page-header { .page-header {
margin-bottom: 24px; margin-bottom: 24px;
} }
.page-header h1 { .page-header h1 {
font-size: 40px; font-size: 40px;
} }
.pagination { .pagination {
display: flex; display: flex;
} }
.pagination a { .pagination a {
color: var(--theme); color: var(--theme);
font-size: 13px; font-size: 13px;
@ -202,15 +233,18 @@ img {
background: var(--primary); background: var(--primary);
border-radius: calc(36px / 2); border-radius: calc(36px / 2);
} }
.pagination .prev { .pagination .prev {
padding-left: 16px; padding-left: 16px;
padding-right: 18px; padding-right: 18px;
} }
.pagination .next { .pagination .next {
margin-left: auto; margin-left: auto;
padding-left: 18px; padding-left: 18px;
padding-right: 16px; padding-right: 16px;
} }
/* Post entry /* Post entry
-------------------------------------------------- */ -------------------------------------------------- */
.first-entry { .first-entry {
@ -221,24 +255,29 @@ img {
height: 320px; height: 320px;
margin-bottom: var(--header-height); margin-bottom: var(--header-height);
} }
.first-entry .entry-header { .first-entry .entry-header {
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
} }
.first-entry .entry-header h2 { .first-entry .entry-header h2 {
font-size: 40px; font-size: 40px;
} }
.first-entry .entry-content { .first-entry .entry-content {
margin-top: 14px; margin-top: 14px;
margin-bottom: 14px; margin-bottom: 14px;
font-size: 16px; font-size: 16px;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
} }
.first-entry .entry-footer { .first-entry .entry-footer {
font-size: 14px; font-size: 14px;
} }
.post-entry { .post-entry {
position: relative; position: relative;
margin-bottom: var(--gap); margin-bottom: var(--gap);
@ -247,16 +286,20 @@ img {
border-radius: var(--radius); border-radius: var(--radius);
transition: transform 0.1s; transition: transform 0.1s;
} }
.post-entry:active { .post-entry:active {
transform: scale(0.96); transform: scale(0.96);
} }
.tag-entry .entry-content, .tag-entry .entry-content,
.tag-entry .entry-footer { .tag-entry .entry-footer {
display: none; display: none;
} }
.entry-header h2 { .entry-header h2 {
font-size: 24px; font-size: 24px;
} }
.entry-content { .entry-content {
margin-top: 8px; margin-top: 8px;
margin-bottom: 8px; margin-bottom: 8px;
@ -268,10 +311,12 @@ img {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
} }
.entry-footer { .entry-footer {
color: var(--secondary); color: var(--secondary);
font-size: 13px; font-size: 13px;
} }
.entry-link { .entry-link {
position: absolute; position: absolute;
left: 0; left: 0;
@ -279,32 +324,39 @@ img {
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
/* Post single /* Post single
-------------------------------------------------- */ -------------------------------------------------- */
.post-header { .post-header {
margin-top: 24px; margin-top: 24px;
margin-bottom: var(--content-gap); margin-bottom: var(--content-gap);
} }
.post-title { .post-title {
margin-bottom: 2px; margin-bottom: 2px;
font-size: 40px; font-size: 40px;
transform: translateX(-2px); transform: translateX(-2px);
} }
.post-meta { .post-meta {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
} }
.post-content { .post-content {
color: var(--content); color: var(--content);
} }
.post-content h1 { .post-content h1 {
margin-top: 40px; margin-top: 40px;
margin-bottom: 32px; margin-bottom: 32px;
} }
.post-content h2 { .post-content h2 {
margin-top: 32px; margin-top: 32px;
margin-bottom: 24px; margin-bottom: 24px;
} }
.post-content h3, .post-content h3,
.post-content h4, .post-content h4,
.post-content h5, .post-content h5,
@ -312,74 +364,93 @@ img {
margin-top: 24px; margin-top: 24px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.post-content h1 { .post-content h1 {
font-size: 40px; font-size: 40px;
} }
.post-content h2 { .post-content h2 {
font-size: 32px; font-size: 32px;
} }
.post-content h3 { .post-content h3 {
font-size: 24px; font-size: 24px;
} }
.post-content h4 { .post-content h4 {
font-size: 16px; font-size: 16px;
} }
.post-content h5 { .post-content h5 {
font-size: 14px; font-size: 14px;
} }
.post-content h6 { .post-content h6 {
font-size: 12px; font-size: 12px;
} }
.post-content a { .post-content a {
box-shadow: 0 1px 0 var(--primary); box-shadow: 0 1px 0 var(--primary);
} }
.post-content a code { .post-content a code {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
border-radius: 0; border-radius: 0;
box-shadow: 0 -1px 0 var(--primary) inset; box-shadow: 0 -1px 0 var(--primary) inset;
} }
.post-content del { .post-content del {
text-decoration: none; text-decoration: none;
background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50% / 1px 1px repeat-x; background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50% / 1px 1px repeat-x;
} }
.post-content p, .post-content p,
.post-content ul, .post-content ul,
.post-content ol, .post-content ol,
.post-content dl { .post-content dl {
margin-bottom: var(--content-gap); margin-bottom: var(--content-gap);
} }
.post-content ul, .post-content ul,
.post-content ol { .post-content ol {
padding-left: 20px; padding-left: 20px;
} }
.post-content li { .post-content li {
margin-top: 5px; margin-top: 5px;
} }
.post-content li p { .post-content li p {
margin-bottom: 0; margin-bottom: 0;
} }
.post-content dl { .post-content dl {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin: 0; margin: 0;
} }
.post-content dt { .post-content dt {
width: 25%; width: 25%;
font-weight: 700; font-weight: 700;
} }
.post-content dd { .post-content dd {
width: 75%; width: 75%;
margin-left: 0; margin-left: 0;
padding-left: 10px; padding-left: 10px;
} }
.post-content dt ~ dt,
.post-content dd ~ dd { .post-content dt~dt,
.post-content dd~dd {
margin-top: 10px; margin-top: 10px;
} }
.post-content table { .post-content table {
margin-bottom: 32px; margin-bottom: 32px;
} }
.post-content table th, .post-content table th,
.post-content table:not(.highlighttable) td { .post-content table:not(.highlighttable) td {
min-width: 80px; min-width: 80px;
@ -387,14 +458,17 @@ img {
line-height: 1.5; line-height: 1.5;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
} }
.post-content table th { .post-content table th {
font-size: 14px; font-size: 14px;
text-align: left; text-align: left;
} }
.post-content table:not(.highlighttable) td code:only-child { .post-content table:not(.highlighttable) td code:only-child {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
} }
.post-content .highlight, .post-content .highlight,
.post-content pre { .post-content pre {
margin-left: calc(var(--gap) * -1); margin-left: calc(var(--gap) * -1);
@ -403,31 +477,39 @@ img {
background: var(--hljs-bg) !important; background: var(--hljs-bg) !important;
border-radius: var(--radius); border-radius: var(--radius);
} }
.post-content ul pre { .post-content ul pre {
margin-left: calc(var(--gap) * -2); margin-left: calc(var(--gap) * -2);
} }
.post-content .highlight pre { .post-content .highlight pre {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
margin-bottom: 0; margin-bottom: 0;
} }
/* table */ /* table */
.post-content .highlighttable { .post-content .highlighttable {
table-layout: fixed; table-layout: fixed;
} }
.post-content .highlighttable td:first-child { .post-content .highlighttable td:first-child {
width: 40px; width: 40px;
} }
.post-content .highlighttable td .linenodiv { .post-content .highlighttable td .linenodiv {
padding-right: 0 !important; padding-right: 0 !important;
} }
.post-content .highlighttable td .linenodiv pre, .post-content .highlighttable td .linenodiv pre,
.post-content .highlighttable td .highlight { .post-content .highlighttable td .highlight {
margin-bottom: 0; margin-bottom: 0;
} }
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { .post-content .highlighttable td .highlight pre code::-webkit-scrollbar {
display: none; display: none;
} }
/* inline */ /* inline */
.post-content .highlight span { .post-content .highlight span {
background: transparent !important; background: transparent !important;
@ -443,6 +525,7 @@ img {
background: var(--code-bg); background: var(--code-bg);
border-radius: 2px; border-radius: 2px;
} }
.post-content pre code { .post-content pre code {
display: block; display: block;
margin-left: 0; margin-left: 0;
@ -452,11 +535,13 @@ img {
background: transparent; background: transparent;
border-radius: 0; border-radius: 0;
} }
.post-content blockquote { .post-content blockquote {
margin: 0 0 0 calc(var(--gap) * -1); margin: 0 0 0 calc(var(--gap) * -1);
padding: 0 0 0 21px; padding: 0 0 0 21px;
border-left: 3px solid var(--primary); border-left: 3px solid var(--primary);
} }
.post-content hr { .post-content hr {
height: 1px; height: 1px;
margin-top: 56px; margin-top: 56px;
@ -465,18 +550,23 @@ img {
border-top: 0; border-top: 0;
border-bottom: 0; border-bottom: 0;
} }
.post-content iframe { .post-content iframe {
max-width: 100%; max-width: 100%;
} }
.post-footer { .post-footer {
margin-top: 56px; margin-top: 56px;
} }
.post-tags li { .post-tags li {
display: inline-block; display: inline-block;
} }
.post-tags li + li {
.post-tags li+li {
margin-left: 3px; margin-left: 3px;
} }
.post-tags a { .post-tags a {
display: block; display: block;
padding-left: 14px; padding-left: 14px;
@ -487,9 +577,11 @@ img {
background: var(--code-bg); background: var(--code-bg);
border-radius: 4px; border-radius: 4px;
} }
.post-tags a:hover { .post-tags a:hover {
background: var(--border); background: var(--border);
} }
/* Footer /* Footer
-------------------------------------------------- */ -------------------------------------------------- */
.footer { .footer {
@ -502,17 +594,21 @@ img {
text-align: center; text-align: center;
line-height: 24px; line-height: 24px;
} }
.footer span { .footer span {
margin-left: 1px; margin-left: 1px;
margin-right: 1px; margin-right: 1px;
} }
.footer a { .footer a {
color: inherit; color: inherit;
} }
.footer a:hover { .footer a:hover {
color: var(--primary); color: var(--primary);
border-bottom: 1px solid var(--primary); border-bottom: 1px solid var(--primary);
} }
/* 404 /* 404
-------------------------------------------------- */ -------------------------------------------------- */
.not-found { .not-found {

View File

@ -17,7 +17,7 @@
<h2>{{ .Title }}</h2> <h2>{{ .Title }}</h2>
</header> </header>
<section class="entry-content"> <section class="entry-content">
<p>{{ .Summary | plainify | htmlUnescape }}...</p> <p>{{ .Summary | plainify | htmlUnescape }}...</p>
</section> </section>
<footer class="entry-footer"> <footer class="entry-footer">
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>

View File

@ -26,7 +26,7 @@
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
<script> <script>
var disqus_shortname = '{{ .Site.DisqusShortname }}'; var disqus_shortname = '{{ .Site.DisqusShortname }}';
(function() { (function () {
var d = document, s = d.createElement('script'); var d = document, s = d.createElement('script');
s.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; s.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date()); s.setAttribute('data-timestamp', +new Date());