hugo-theme-zzo/assets/sass/pages/_single.scss

610 lines
12 KiB
SCSS
Raw Normal View History

2019-11-04 13:09:44 +00:00
.single {
padding: 1rem;
position: relative;
width: 100%;
2019-12-01 07:37:10 +00:00
overflow-wrap: break-word;
2019-11-04 13:09:44 +00:00
&__title {
font-size: 2.5rem;
2019-11-04 13:09:44 +00:00
font-weight: 900;
font-family: $title-font;
2019-11-04 13:09:44 +00:00
line-height: 3rem;
overflow-wrap: break-word;
2020-01-24 07:05:56 +00:00
margin-top: 1.5rem;
margin-bottom: 0.5rem;
2019-11-04 13:09:44 +00:00
@include themify($themes) {
color: themed("single-header-title-color");
}
&[data-ani="true"] {
@include animation('slide-in-down .2s .3s 1 ease-in both');
}
2019-11-04 13:09:44 +00:00
}
2020-02-05 17:23:27 +00:00
&__shorttitle {
font-size: 1.5rem;
font-family: $title-font;
overflow-wrap: break-word;
margin-bottom: 0.25rem;
opacity: 0.7;
@include themify($themes) {
color: themed("single-header-title-color");
}
}
2019-11-04 13:09:44 +00:00
&__meta {
font-size: 0.8rem;
2020-01-24 07:05:56 +00:00
margin-bottom: 2rem;
2019-12-05 13:57:05 +00:00
2019-11-04 13:09:44 +00:00
@include flexbox();
@include align-items(center);
2019-12-05 13:57:05 +00:00
@include flex-wrap(wrap);
2020-01-17 07:58:51 +00:00
@include flex-grow(1);
2019-12-08 14:29:02 +00:00
@include themify($themes) {
color: themed('meta-color');
}
@media only screen and (max-width: 769px) {
@include flexbox();
@include flex-direction(column);
@include align-items(flex-start);
}
2019-11-04 13:09:44 +00:00
}
2019-12-05 13:57:05 +00:00
&__infos {
margin-right: 0.5rem;
@include flexbox();
@include flex-wrap(wrap);
}
&__info {
word-break: keep-all;
padding: 0 0.125rem;
2019-12-05 13:57:05 +00:00
}
2019-11-04 13:09:44 +00:00
&__contents {
&[data-ani="true"] {
@include animation('slide-in-left-little .2s .6s 1 ease-in both');
}
&--gallery {
overflow: hidden;
}
2020-01-17 07:58:51 +00:00
& > p > a {
text-decoration: underline;
}
2019-11-04 13:09:44 +00:00
margin: 1rem 0;
2020-01-26 12:28:16 +00:00
font-size: 1rem;
2019-12-08 15:39:10 +00:00
line-height: 1.7;
2019-11-04 13:09:44 +00:00
width: inheirt;
max-width: inherit;
h1,
h2,
h3,
h4,
h5,
h6 {
2019-12-17 18:14:07 +00:00
position: relative;
line-height: 1.25;
font-family: $title-font;
}
h1,
h2 {
padding: 0;
color: inherit;
font-weight: 900;
text-rendering: optimizeLegibility;
2019-11-04 13:09:44 +00:00
@include themify($themes) {
color: themed("single-contents-title-color");
}
}
2020-01-07 07:30:51 +00:00
h3,
h4,
h5,
h6 {
@include themify($themes) {
color: themed("single-contents-subtitle-color");
}
}
2019-11-04 13:09:44 +00:00
h1 {
font-size: 2.6rem;
margin: 3.5rem 0 1.75rem 0;
}
h2 {
font-size: 2.2rem;
margin: 3.2rem 0 1.5rem 0;
}
h3 {
font-size: 1.8rem;
margin: 2.8rem 0 1.25rem 0;
}
h4 {
font-size: 1.5rem;
margin: 2.4rem 0 1rem 0;
}
h5 {
font-size: 1.2rem;
margin: 2rem 0 0.8rem 0;
}
h6 {
font-size: 1rem;
margin: 1.5rem 0 0.5rem 0;
}
pre {
padding: 34px 12px 8px;
overflow: auto;
border-radius: 0.34rem;
line-height: 1.5;
2020-01-26 12:28:16 +00:00
font-size: 13.8px;
direction: ltr;
2020-01-26 04:44:09 +00:00
@include themify($themes) {
@include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
@include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
}
}
pre:not(.chroma) {
position: relative;
}
div.chroma {
position: relative;
@include on-event {
.copy-to-clipboard {
opacity: 1;
}
}
}
pre > code:not([class^=language]) {
&::before {
position: absolute;
top: 0;
left: 0;
padding: 2px 7px;
width: 100%;
height: 30px;
z-index: z('content');
line-height: 30px;
2020-01-26 12:28:16 +00:00
font-size: 13.8px;
font-family: $title-font;
font-weight: bold;
display: inline-block;
text-transform: capitalize;
content: 'Code';
@include themify($codeblock) {
color: themed('content-pre-header-color');
background: themed('content-pre-header-background-color');
}
}
}
p > code:not([class^=language]) {
padding: 0.25rem 0.5rem;
2019-12-28 15:31:06 +00:00
@include themify($codeblock) {
color: themed('content-code-color');
}
}
2019-11-04 13:09:44 +00:00
code + .copy-to-clipboard {
position: absolute;
right: 4px;
top: 5px;
border-radius: 2px;
z-index: z('clipboard');
@include transition(all, 0.2s, ease);
2019-11-04 13:09:44 +00:00
}
.copy-to-clipboard {
background-position: 50% 50%;
background-size: 16px 16px;
background-repeat: no-repeat;
width: 27px;
height: 1.45rem;
top: -1px;
vertical-align: middle;
position: relative;
margin-left: -0.2rem;
cursor: pointer;
border-radius: 0 2px 2px 0;
margin-bottom: 1px;
opacity: 0;
@include clippy();
2019-11-04 13:09:44 +00:00
@include transition(all, 0.2s, ease);
}
.copy-to-clipboard:hover {
@include translateY(-0.1rem);
2019-11-04 13:09:44 +00:00
}
.chroma .copy-to-clipboard {
2019-11-04 13:09:44 +00:00
position: absolute;
right: 4px;
top: 5px;
2019-11-04 13:09:44 +00:00
border-radius: 2px;
z-index: z('clipboard');
2019-11-04 13:09:44 +00:00
@include transition(all, 0.2s, ease);
}
.chroma .copy-to-clipboard:hover {
@include translateY(-0.1rem);
2019-11-04 13:09:44 +00:00
}
2019-11-28 15:43:35 +00:00
.language-code .copy-to-clipboard {
position: absolute;
right: 4px;
top: 5px;
border-radius: 2px;
z-index: z('clipboard');
2019-11-28 15:43:35 +00:00
@include transition(all, 0.2s, ease);
}
.language-code .copy-to-clipboard:hover {
@include translateY(-0.1rem);
}
2019-11-04 13:09:44 +00:00
blockquote {
font-size: 1.05rem;
2019-12-08 15:39:10 +00:00
line-height: 1.75;
2019-11-04 13:09:44 +00:00
color: inherit;
opacity: 0.8;
position: relative;
2020-01-07 07:30:51 +00:00
code:not([class^=language]) {
padding: 3px 7px;
margin: 0 0.25rem;
@include themify($codeblock) {
color: themed('content-code-color');
}
2019-11-04 13:09:44 +00:00
}
}
img {
display: block;
border-radius: 0.25rem;
margin: 0 auto;
}
p {
margin: 0 0 1.75rem 0;
padding: 0;
2019-11-04 13:09:44 +00:00
2020-01-07 07:30:51 +00:00
code:not([class^=language]) {
padding: 3px 7px;
margin: 0 0.25rem;
@include themify($codeblock) {
color: themed('content-code-color');
}
}
2019-11-04 13:09:44 +00:00
}
ul {
margin-right: 0;
margin-top: 0;
padding: 0;
list-style: disc outside none;
}
&[data-dir="rtl"] {
li {
margin-right: 2rem;
}
2020-02-16 16:29:39 +00:00
blockquote {
margin: 0 1.5rem 1.75rem 1.75rem;
padding: 0 1.42188rem 0 0;
@include themify($themes) {
border-right: 0.32813rem solid themed("single-blockquote-border-color");
}
}
}
&[data-dir="ltr"] {
li {
margin-left: 2rem;
}
2020-02-16 16:29:39 +00:00
blockquote {
margin: 0 1.75rem 1.75rem 1.5rem;
padding: 0 0 0 1.42188rem;
@include themify($themes) {
border-left: 0.32813rem solid themed("single-blockquote-border-color");
}
}
}
2019-11-04 13:09:44 +00:00
li {
margin-bottom: calc(1rem / 2);
& > code {
padding: 2px 7px;
}
2020-01-07 07:30:51 +00:00
code:not([class^=language]) {
@include themify($codeblock) {
color: themed('content-code-color');
}
}
2020-02-22 14:47:08 +00:00
p {
margin-bottom: 0.5rem;
}
2019-11-04 13:09:44 +00:00
}
hr {
margin: 0 0 calc(1.25rem - 1px) 0;
2019-11-04 13:09:44 +00:00
padding: 0;
border: none;
height: 1px;
@include themify($themes) {
background: themed("single-hr-background-color");
}
}
dl dt::after {
content: ':';
}
dd {
display: block;
margin-inline-start: 40px;
}
2019-11-04 13:09:44 +00:00
.anchor {
cursor: pointer;
}
a.footnote-ref {
font-size: 0.75rem;
font-weight: bold;
margin-left: 3px;
&::before {
content: "[";
}
&::after {
content: "]";
}
}
.table-wrapper {
overflow-x: auto;
> table {
max-width: 100%;
margin: 10px 0;
border-spacing: 0;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.125);
@include themify($codeblock) {
thead {
background: themed('content-pre-header-background-color');
}
th {
color: themed('content-pre-header-color');
}
th, td {
2020-01-30 16:17:56 +00:00
padding: 0.25rem 0.5rem;
border: 1px double themed('content-pre-border-background-color');
}
}
}
2020-01-07 07:30:51 +00:00
code:not([class^=language]) {
padding: 3px 7px;
margin: 0 0.25rem;
@include themify($codeblock) {
color: themed('content-code-color');
}
}
}
2019-11-04 13:09:44 +00:00
}
&__tags {
list-style-type: none;
@include flexbox();
@include align-items(center);
@include flex-wrap(wrap);
2019-12-05 13:57:05 +00:00
@include flex-grow(1);
}
&__tag {
padding: 0 0.25rem;
}
}
code, pre {
padding: .5rem 0;
line-height: 1.5;
2020-01-26 12:28:16 +00:00
font-size: 13.8px;
font-family: $code-font-stack;
overflow: auto;
a {
text-decoration: none !important;
}
}
*:not(.chroma) {
code, pre {
@include themify($codeblock) {
color: themed('content-pre-color');
background: themed('content-pre-background-color');
}
}
code {
padding: 0;
}
}
2020-01-07 07:30:51 +00:00
code:not([class^=language]) {
padding: 3px 0;
border-radius: 4px;
@include themify($codeblock) {
color: themed('content-code-color');
}
}
pre:not(.chroma) {
overflow: auto;
}
2020-01-07 07:30:51 +00:00
.single__contents > .language-code, li > .language-code {
2019-11-28 15:43:35 +00:00
overflow-x: auto;
position: relative;
margin: 1rem 0;
direction: ltr;
@include on-event {
.copy-to-clipboard {
opacity: 1;
}
}
&::after {
position: absolute;
top: 0;
right: 0;
left: 0;
padding: 2px 7px;
width: 100%;
height: 30px;
z-index: z('toc');
border-top-left-radius: 0.25rem;
border-top-right-radius: 0.25rem;
content: '';
@include themify($codeblock) {
color: themed('content-pre-header-color');
background: themed('content-pre-header-background-color');
}
}
}
.highlight > .chroma {
margin: 1em 0;
border-radius: 5px;
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
z-index: z('content');
overflow-x: auto;
direction: ltr;
2019-11-28 15:43:35 +00:00
@include themify($codeblock) {
color: themed('content-pre-color');
background: themed('content-pre-background-color');
}
code {
padding: 0;
}
code[data-lang] {
&::before {
position: absolute;
top: 0;
left: 0;
z-index: z('grid');
padding: 2px 7px;
width: 100%;
height: 30px;
line-height: 1.9;
2020-01-26 12:28:16 +00:00
font-size: 13.8px;
font-family: $title-font;
font-weight: bold;
display: inline-block;
text-transform: capitalize;
content: attr(data-lang);
@include themify($codeblock) {
color: themed('content-pre-header-color');
background: themed('content-pre-header-background-color');
}
}
}
table, tr, td {
margin: 0;
padding: 0;
width: 100%;
border-collapse: collapse;
}
.lntd {
&:first-child {
width: 10px;
@include no-select;
pre {
margin: 0;
padding: 34px 4px 6px;
}
}
&:last-child {
vertical-align: top;
pre {
margin: 0;
padding: 34px 4px 6px;
}
}
}
/* LineNumbersTable */
.lnt {
@include themify($codeblock) {
color: themed('content-pre-number-color');
}
}
table.lntable {
overflow-x: auto;
@include themify($themes) {
@include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
@include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
}
}
2020-01-07 07:30:51 +00:00
}
li .highlight > .chroma {
.lnt:first-child {
padding: 0 0.3rem;
2020-01-07 07:30:51 +00:00
}
.lnt:not(:first-child) {
padding: 0 0.3rem;
2020-01-07 07:30:51 +00:00
}
2020-01-26 08:48:03 +00:00
}
2020-01-26 10:59:22 +00:00
td:not(.lntd) {
2020-01-26 08:48:03 +00:00
code {
padding: 2px 7px !important;
}
}
table:not(.lntable) {
td {
code {
padding: 2px 7px !important;
}
}
}