hugo-geekblog/src/sass/_markdown.scss

185 lines
2.8 KiB
SCSS
Raw Normal View History

2020-07-06 20:55:32 +02:00
.gblog-markdown {
line-height: 1.6em;
> :first-child {
2021-11-21 12:55:56 +01:00
margin-top: 0 !important;
2020-07-06 20:55:32 +02:00
}
&--nested {
:first-child {
margin-top: 0;
}
2021-11-21 12:55:56 +01:00
> pre {
margin-top: 0 !important;
}
2020-07-06 20:55:32 +02:00
> :last-child {
margin-bottom: 0;
}
}
2021-11-23 16:53:25 +01:00
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
> code {
border-top: $border-4 solid var(--accent-color);
font-size: 0.75em !important;
}
}
h4,
h5,
h6 {
> code {
font-size: 0.8rem !important;
}
}
2020-07-06 20:55:32 +02:00
b,
optgroup,
strong {
font-weight: bolder;
}
&__link--raw {
text-decoration: none !important;
color: $body-font-color !important;
&:hover {
background: none !important;
color: $body-font-color !important;
text-decoration: none !important;
}
&:visited {
color: $body-font-color !important;
}
}
&__link--code {
text-decoration: none;
code {
color: inherit !important;
}
&:hover {
background: none;
color: var(--link-color) !important;
text-decoration: underline;
}
&:visited,
&:visited:hover {
color: var(--link-color-visited) !important;
}
}
2021-11-23 16:53:25 +01:00
img {
max-width: 100%;
border-radius: $border-radius;
}
2020-07-06 20:55:32 +02:00
blockquote {
margin: $padding-16 0;
padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp
2021-11-23 16:53:25 +01:00
border-left: $border-4 solid var(--accent-color);
2020-07-06 20:55:32 +02:00
border-radius: $border-radius;
:first-child {
margin-top: 0;
}
:last-child {
margin-bottom: 0;
}
}
2021-11-23 16:53:25 +01:00
table:not(.lntable) {
2020-07-18 16:17:30 +02:00
display: table;
2020-07-06 20:55:32 +02:00
border-spacing: 0;
border-collapse: collapse;
margin-top: $padding-16;
margin-bottom: $padding-16;
2020-07-18 16:17:30 +02:00
width: 100%;
text-align: left;
thead {
2021-11-23 16:53:25 +01:00
border-bottom: $border-4 solid var(--accent-color);
2020-07-18 16:17:30 +02:00
}
2020-07-06 20:55:32 +02:00
tr th,
tr td {
padding: $padding-8 $padding-16;
2020-07-18 16:17:30 +02:00
}
tr {
2021-11-23 16:53:25 +01:00
border-bottom: $border-2 solid var(--accent-color);
2020-07-06 20:55:32 +02:00
}
tr:nth-child(2n) {
2021-11-23 16:53:25 +01:00
background: var(--accent-color-lite);
2020-07-06 20:55:32 +02:00
}
}
hr {
2021-11-23 16:53:25 +01:00
height: $border-2;
2020-07-06 20:55:32 +02:00
border: none;
2021-11-23 16:53:25 +01:00
background: var(--accent-color);
2020-07-06 20:55:32 +02:00
}
ul,
ol {
padding-left: $padding-32;
2020-07-06 20:55:32 +02:00
}
dl {
dt {
font-weight: bolder;
margin-top: $padding-16;
}
dd {
margin-left: $padding-32;
2020-07-06 20:55:32 +02:00
}
}
pre {
margin: 1rem 0;
}
code {
padding: 0.2em 0.4em;
}
pre,
2020-07-06 20:55:32 +02:00
code {
2021-11-23 16:53:25 +01:00
background-color: var(--code-background);
border-radius: $border-radius;
color: var(--code-font-color);
font-size: 0.85rem;
2021-11-23 16:53:25 +01:00
line-height: 1.45em;
2020-07-06 20:55:32 +02:00
}
pre code {
2020-07-06 20:55:32 +02:00
display: block;
padding: 1rem;
width: 100%;
}
2020-07-13 22:11:38 +02:00
mark {
2021-11-23 16:53:25 +01:00
background-color: var(--mark-color);
2020-07-13 22:11:38 +02:00
}
section.footnotes {
margin-top: 3rem;
2021-11-23 16:53:25 +01:00
color: var(--body-font-color);
font-size: $font-size-14;
2020-07-13 22:11:38 +02:00
}
2020-07-06 20:55:32 +02:00
}