blog/src/styles/post.scss

264 lines
4.1 KiB
SCSS
Raw Normal View History

2023-09-01 17:38:59 +00:00
@use "variables";
2023-08-31 08:07:03 +00:00
.post-title {
font-size: 2rem;
2023-09-01 02:53:16 +00:00
font-weight: 600;
2023-09-02 01:59:23 +00:00
margin-top: 20px;
2023-08-31 08:07:03 +00:00
margin-bottom: 12px;
}
.post-meta {
display: block;
margin-bottom: 20px;
}
2023-08-31 15:33:14 +00:00
.hero {
display: block;
width: 100%;
height: 180px;
background-size: cover;
aspect-ratio: 1;
border-radius: 8px;
2023-08-31 20:17:40 +00:00
margin: 16px 0;
2023-08-31 15:33:14 +00:00
}
2023-08-31 08:07:03 +00:00
.post-container {
2023-09-01 17:38:59 +00:00
max-width: 720px;
2023-08-31 08:07:03 +00:00
display: flex;
2023-09-01 17:38:59 +00:00
padding: 20px;
2023-08-31 08:07:03 +00:00
flex-direction: column;
.toc-drawer {
display: block;
summary {
font-weight: bold;
}
}
.toc-list {
display: none;
}
2023-09-01 03:45:24 +00:00
p > img {
2023-08-31 15:33:14 +00:00
max-width: 100%;
height: auto;
2023-09-01 02:59:12 +00:00
border-radius: 8px;
border: 1px solid var(--hr-color);
2023-08-31 15:33:14 +00:00
}
2023-09-01 03:45:24 +00:00
pre > code {
padding: 12px;
border-radius: 8px;
border: 1px solid var(--hr-color);
}
2023-08-31 08:07:03 +00:00
/*
@media screen and (max-width: 520px) {
flex-direction: column;
.toc-drawer { display: block; }
.toc-list { display: none; }
}
@media screen and (min-width: 520px) {
flex-direction: row;
align-items: flex-start;
gap: 12px;
.toc-drawer { display: none; }
.toc-list {
top: 0;
display: block;
position: sticky;
min-width: 160px;
}
}
*/
.post-content {
ul:not(.tabs) {
padding-left: 1.5rem;
}
min-width: 1px;
details {
border: 1px solid var(--hr-color);
// padding: 10px 30px;
font-size: 0.9rem;
padding: 0 30px;
line-height: 1.5;
2023-09-01 14:16:36 +00:00
position: relative;
2023-08-31 08:07:03 +00:00
p:nth-of-type(1) {
padding-top: 0;
margin-top: 0;
}
summary {
2023-09-01 14:16:36 +00:00
cursor: pointer;
2023-08-31 08:07:03 +00:00
padding: 10px 0;
transition: margin 150ms ease-out;
2023-09-01 14:16:36 +00:00
position: sticky;
top: 0;
background-color: var(--background-color);
2023-08-31 08:07:03 +00:00
}
&[open] summary {
border-bottom: 1px dotted var(--hr-color);
margin-bottom: 15px;
}
}
hr {
border-width: 1px 0 0 0;
border-color: var(--hr-color);
margin: 32px auto;
width: 20%;
}
.highlight {
.lntd:first-child {
// border-right: 1px solid lightgray;
padding-right: 2px;
}
.lntd:last-child {
padding-left: 12px;
}
}
.highlight,
details {
margin-top: 16px;
margin-bottom: 16px;
}
}
&.logseq-post {
.post-content {
> ul {
list-style-type: none;
padding: 0;
> li {
margin-bottom: 1em;
}
}
}
}
.toc-draw #TableOfContents,
.toc-list #TableOfContents {
ul {
list-style-type: "\25B8\00A0";
padding-left: 1rem;
li {
margin-bottom: 0.5rem;
}
}
li ul {
margin-top: 0.5rem;
}
}
table {
border-collapse: collapse;
2023-09-01 17:05:29 +00:00
border: 1px solid var(--hr-color);
border-radius: 4px;
2023-08-31 08:07:03 +00:00
thead {
2023-09-01 17:05:29 +00:00
background-color: var(--hr-color);
// color: var(--background-color);
2023-08-31 08:07:03 +00:00
}
td,
th {
padding: 5px 10px;
}
}
}
2023-09-01 17:38:59 +00:00
@media screen and (min-width: variables.$breakpoint) {
.post-container {
padding-left: 30px;
2023-09-02 00:30:15 +00:00
padding-right: 30px;
2023-09-01 17:38:59 +00:00
}
}
2023-08-31 08:07:03 +00:00
.division .post-content,
.post-content {
.heading {
font-weight: 500;
a {
color: var(--heading-color);
}
}
> p {
2023-08-31 15:33:14 +00:00
line-height: 1.25;
2023-08-31 08:07:03 +00:00
}
> p > img {
display: block;
margin: auto;
}
.footnotes {
font-size: 0.9em;
2023-08-31 15:33:14 +00:00
line-height: 1.05;
2023-08-31 08:07:03 +00:00
}
}
hr.endline {
margin-top: 30px;
border-width: 1px 0 0 0;
border-color: var(--hr-color);
}
2023-09-01 14:16:36 +00:00
.tags {
display: flex;
gap: 6px;
margin-bottom: 6px;
2023-09-01 17:38:59 +00:00
flex-wrap: wrap;
2023-09-01 14:16:36 +00:00
.tag {
font-size: 0.75rem;
background-color: var(--tag-color);
padding: 2px 7px;
border-radius: 4px;
&.draft {
background-color: orange;
color: black;
}
.text {
text-decoration: none;
}
&:hover {
text-decoration: none;
}
}
}
2023-09-01 15:09:01 +00:00
.admonition {
// TODO: Figure out how to distinguish admonitions
--color: var(--link-color);
border-left: 4px solid var(--color);
padding-left: 8px;
font-size: 0.9rem;
.admonition-title {
color: var(--color);
}
p {
2023-09-01 17:05:29 +00:00
margin: 8px auto;
2023-09-01 15:09:01 +00:00
}
}