1
0
Fork 0
hugo-paper/assets/app.css

663 lines
10 KiB
CSS
Raw Normal View History

2021-08-20 13:21:20 +02:00
/*
* Paper
* A simple, clean, flexible Hugo theme
* https://github.com/nanxiaobei/hugo-paper
* Designed by 南小北 (https://lee.so/)
2021-08-24 03:09:37 +02:00
* Updated in 2021.8.24
2021-08-20 13:21:20 +02:00
*/
/* Theme
-------------------------------------------------- */
:root {
--gap: 3.5rem;
--y-gap: 8rem;
--wide: 140rem;
--narrow: 80rem;
--side: calc((var(--wide) - var(--narrow)) / 2);
--header: 8rem;
--footer: 8rem;
--light: 255, 255, 255;
--dark: 22, 22, 22;
--hljs-bg: #111;
}
.dark {
--light: 22, 22, 22;
--dark: 255, 255, 255;
--hljs-bg: #282828;
}
2021-08-23 22:08:41 +02:00
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
2021-08-20 19:49:02 +02:00
height: 100%;
2021-08-23 22:08:41 +02:00
}
html {
2021-08-20 13:21:20 +02:00
-webkit-tap-highlight-color: transparent;
font-size: 8px;
}
body {
--white: rgba(var(--light), 1);
--black: rgba(var(--dark), 1);
--pro: rgba(var(--dark), 1);
--lit: rgba(var(--dark), 0.64);
--air: rgba(var(--dark), 0.48);
--fog: rgba(var(--dark), 0.12);
2021-08-20 19:30:41 +02:00
display: flex;
flex-direction: column;
padding-right: var(--gap);
padding-left: var(--gap);
2021-08-20 13:21:20 +02:00
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 2rem;
line-height: 1.8;
color: var(--pro);
word-break: break-word;
background: var(--white);
transition: background 0.4s ease-out;
}
2021-08-20 19:30:41 +02:00
body > * {
2021-08-23 22:08:41 +02:00
flex-shrink: 0;
2021-08-20 19:30:41 +02:00
width: 100%;
margin-inline: auto;
}
2021-08-20 13:21:20 +02:00
.not-ready,
2021-08-20 22:05:13 +02:00
.not-ready * {
2021-08-20 13:21:20 +02:00
transition: none !important;
}
@media (max-width: 1199px) {
html {
font-size: 7px;
}
}
/* Reset
-------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-size: inherit;
font-weight: 700;
line-height: 1.2;
}
p {
margin: 0;
}
strong,
b {
font-weight: 500;
}
ul,
ol {
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
table {
width: 100%;
border-spacing: 0;
border-collapse: collapse;
}
button,
input,
textarea {
padding: 0;
font: inherit;
background: transparent;
border: 0;
outline: 0;
-webkit-appearance: none;
}
button,
input[type='button'],
input[type='submit'] {
cursor: pointer;
}
input,
textarea {
padding: 0;
border: 0;
}
input:-webkit-autofill,
textarea:-webkit-autofill {
box-shadow: 0 0 0 6rem var(--white) inset;
}
img {
display: block;
max-width: 100%;
}
/* Header
-------------------------------------------------- */
.header {
display: flex;
max-width: var(--wide);
height: var(--header);
}
.header a {
display: flex;
flex-shrink: 0;
align-items: center;
}
.logo {
display: flex;
2021-08-23 22:08:41 +02:00
min-width: var(--side);
padding-right: var(--gap);
2021-08-20 13:21:20 +02:00
}
.site-name {
2021-08-23 22:08:41 +02:00
max-width: calc(100% - 2rem - 3rem);
2021-08-20 19:01:05 +02:00
padding-bottom: 0.3rem;
2021-08-23 22:08:41 +02:00
overflow: auto;
2021-08-20 13:21:20 +02:00
font-size: 3.5rem;
font-weight: 700;
2021-08-23 22:08:41 +02:00
white-space: nowrap;
2021-08-20 13:21:20 +02:00
}
.btn-theme {
width: 3rem;
margin-left: 2rem;
cursor: pointer;
2021-08-23 22:08:41 +02:00
background: url(./theme.png) left / auto 3rem no-repeat;
2021-08-20 22:05:13 +02:00
transition: background-position 0.4s steps(6);
2021-08-20 13:21:20 +02:00
}
2021-08-20 22:05:13 +02:00
.dark .btn-theme {
background-position: right;
2021-08-20 13:21:20 +02:00
}
.menu {
display: flex;
overflow: auto;
}
.menu a + a {
margin-left: var(--gap);
}
2021-08-20 22:05:13 +02:00
.menu a.active {
2021-08-23 22:08:41 +02:00
opacity: 0.44;
2021-08-20 22:05:13 +02:00
}
2021-08-23 22:08:41 +02:00
.social {
display: flex;
2021-08-20 13:21:20 +02:00
margin-left: auto;
}
2021-08-23 22:08:41 +02:00
.social a {
width: 3rem;
margin-left: 3rem;
2021-08-24 04:14:27 +02:00
background: var(--url) center center no-repeat;
2021-08-20 13:21:20 +02:00
}
2021-08-23 22:08:41 +02:00
.dark .social a {
2021-08-20 13:21:20 +02:00
filter: invert(1);
}
@media (max-width: 1199px) {
.logo {
min-width: auto;
}
[data-menu='true'] {
--header: 16rem;
}
[data-menu='true'] .header {
position: relative;
}
[data-menu='true'] .header > * {
height: calc(var(--header) / 2);
}
[data-menu='true'] .menu {
position: absolute;
inset: auto 0 0;
border-bottom: 1px solid var(--fog);
}
}
/* Main
-------------------------------------------------- */
.main {
max-width: var(--narrow);
2021-08-23 22:08:41 +02:00
min-height: calc(100% - var(--header) - var(--footer));
2021-08-20 19:30:41 +02:00
padding-top: var(--y-gap);
padding-bottom: var(--y-gap);
2021-08-20 13:21:20 +02:00
}
2021-08-23 22:08:41 +02:00
.main-title {
2021-08-20 13:21:20 +02:00
margin-bottom: calc(var(--y-gap) - 1rem);
font-size: 4rem;
font-weight: 400;
color: var(--air);
}
2021-08-23 22:08:41 +02:00
.main-nav {
2021-08-20 13:21:20 +02:00
display: flex;
margin-top: 5rem;
}
2021-08-23 22:08:41 +02:00
.main-nav a {
2021-08-20 13:21:20 +02:00
line-height: 5.5rem;
color: var(--white);
background: var(--black);
border-radius: 0.5rem;
padding-inline: 2.5rem;
}
2021-08-23 22:08:41 +02:00
.main-nav .next {
2021-08-20 13:21:20 +02:00
margin-left: auto;
}
/* Post entry
-------------------------------------------------- */
.post-entry {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
padding-block: 2rem;
transition: transform 0.1s;
}
.post-entry:first-of-type {
margin-top: -2rem;
}
.post-entry:active {
transform: scale(0.99);
}
.post-entry h2 {
padding-right: 2rem;
font-size: 3rem;
}
.post-entry time {
flex-shrink: 0;
font-size: 1.8rem;
color: var(--air);
}
.post-entry a {
position: absolute;
inset: 0;
}
/* Post single
-------------------------------------------------- */
.post-title {
display: flex;
margin-bottom: calc(var(--y-gap) + 1rem);
}
.post-title aside {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: var(--side);
padding-right: var(--gap);
margin-left: calc(var(--side) * -1);
font-size: 1.5rem;
color: var(--air);
transform: translateY(0.4rem);
}
.post-title h1 {
font-size: 5rem;
transform: translateX(-0.3rem);
}
.post-tags {
margin-top: 7rem;
}
.post-tags a {
display: inline-block;
padding-inline: 2rem;
line-height: 5rem;
color: var(--lit);
border: 1px solid var(--fog);
border-radius: 0.5rem;
}
.post-tags a + a {
margin-left: 0.5rem;
}
.post-nav {
display: flex;
justify-content: space-between;
margin-top: var(--y-gap);
2021-08-20 19:30:41 +02:00
margin-right: calc(var(--gap) * -1);
margin-left: calc(var(--gap) * -1);
2021-08-20 13:21:20 +02:00
color: var(--white);
background: var(--black);
border-radius: 0.5rem;
}
.post-nav a {
display: flex;
align-items: center;
width: 50%;
padding: var(--gap);
font-size: 2.5rem;
font-weight: 700;
line-height: 1.2;
}
.post-nav a span + span {
margin-left: 1rem;
}
.post-nav .prev {
padding-right: 1rem;
}
.post-nav .next {
justify-content: flex-end;
padding-left: 1rem;
margin-left: auto;
}
.post-comments {
margin-top: var(--y-gap);
}
@media (max-width: 1199px) {
.post-title {
display: block;
}
.post-title aside {
flex-direction: row;
width: auto;
padding-right: 0;
margin-bottom: 0.5rem;
margin-left: 0;
transform: none;
}
.post-title aside span::before {
content: '·';
margin-inline: 0.5rem;
}
}
/* Post content
-------------------------------------------------- */
.post-content {
font-size: 2.2rem;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
2021-08-24 03:09:37 +02:00
margin-block: 2rem;
2021-08-20 13:21:20 +02:00
}
.post-content h1 {
margin-top: var(--y-gap);
font-size: 5rem;
}
.post-content h2 {
margin-top: 6rem;
font-size: 4rem;
}
.post-content h3 {
font-size: 3rem;
}
.post-content h4 {
font-size: 2.5rem;
}
.post-content h5 {
font-size: 2rem;
}
.post-content h6 {
font-size: 1.5rem;
}
2021-08-24 03:09:37 +02:00
.post-content img {
margin-inline: auto;
}
2021-08-20 13:21:20 +02:00
.post-content a {
padding-bottom: 1px;
border-bottom: 1.5px solid var(--pro);
}
.post-content a code {
margin-inline: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.post-content del {
text-decoration: none;
background: linear-gradient(to right, var(--pro) 100%, transparent 0) 0 50% / 1px 1px repeat-x;
}
.post-content p,
.post-content ul,
.post-content ol,
2021-08-23 22:08:41 +02:00
.post-content dl,
.post-content details {
2021-08-20 13:21:20 +02:00
margin-bottom: 3rem;
}
.post-content ul,
.post-content ol {
padding-left: 2.5rem;
}
.post-content li {
margin-top: 0.6rem;
}
.post-content li p {
margin-bottom: 0;
}
.post-content dl {
display: flex;
flex-wrap: wrap;
margin: 0;
}
.post-content dt {
width: 25%;
font-weight: 500;
}
.post-content dd {
width: 75%;
padding-left: 1.3rem;
margin-left: 0;
}
.post-content dt ~ dt,
.post-content dd ~ dd {
margin-top: 1.3rem;
}
.post-content table {
margin-bottom: 4rem;
}
.post-content table th,
.post-content table:not(.highlighttable) td {
min-width: 10rem;
padding: 1.5rem 1rem;
line-height: 1.5;
border-bottom: 1px solid var(--fog);
}
.post-content table th {
font-size: 1.6rem;
text-align: left;
}
.post-content table:not(.highlighttable) td code:only-of-type {
margin-inline: 0;
}
.post-content .highlight,
.post-content pre {
margin: 0 calc(var(--gap) * -1) 4rem;
overflow-x: auto;
background: var(--hljs-bg) !important;
border-radius: 0.5rem;
}
.post-content ul pre {
margin-left: calc(var(--gap) * -2);
}
.post-content .highlight pre {
margin-inline: 0;
margin-bottom: 0;
}
/* table */
.post-content .highlighttable {
table-layout: fixed;
}
.post-content .highlighttable td:first-of-type {
width: 5rem;
}
.post-content .highlighttable td .linenodiv {
padding-right: 0 !important;
}
.post-content .highlighttable td .linenodiv pre,
.post-content .highlighttable td .highlight {
margin-bottom: 0;
}
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar {
display: none;
}
/* inline */
.post-content .highlight span {
background: transparent !important;
}
.post-content code {
padding: 0.5rem 1rem;
margin-inline: 0.5rem;
font-family: Menlo, Monaco, 'Courier New', Courier, monospace;
font-size: 0.8em;
line-height: 1.5;
background: rgba(var(--dark), 0.06);
border-radius: 0.3rem;
}
.post-content pre code {
display: block;
padding: var(--gap);
margin-inline: 0;
color: rgba(255, 255, 255, 0.8);
background: transparent;
border-radius: 0;
}
.post-content blockquote {
padding: 0 0 0 calc(var(--gap) - 0.4rem);
margin: 0 0 0 calc(var(--gap) * -1);
border-left: 0.4rem solid var(--pro);
}
.post-content hr {
height: 1px;
margin-block: 8rem;
background: var(--fog);
border: 0;
}
.post-content iframe {
width: 100%;
background: var(--black);
}
/* Footer
-------------------------------------------------- */
.footer {
display: flex;
align-items: center;
justify-content: center;
max-width: var(--narrow);
2021-08-20 19:30:41 +02:00
height: var(--footer);
margin-top: auto;
2021-08-20 13:21:20 +02:00
font-size: 1.6rem;
color: var(--lit);
border-top: 1px solid var(--fog);
}
.footer p + p::before {
content: '·';
margin-inline: 0.6rem;
}
.footer a:hover {
color: var(--pro);
border-bottom: 1px solid var(--pro);
}
/* 404
-------------------------------------------------- */
2021-08-20 18:48:17 +02:00
.title-404 {
2021-08-20 13:21:20 +02:00
display: flex;
align-items: center;
justify-content: center;
2021-08-23 22:08:41 +02:00
height: 100%;
padding-bottom: 8rem;
2021-08-20 13:21:20 +02:00
font-size: 16rem;
}