web/_sass/layout/post.scss

358 lines
5.7 KiB
SCSS
Raw Normal View History

2021-01-23 08:20:58 +03:00
/*
Post-specific style
*/
%btn-post-nav {
2020-02-25 12:56:03 +03:00
width: 50%;
position: relative;
border-color: var(--btn-border-color);
2020-02-25 12:56:03 +03:00
}
@mixin dot($pl: 0.25rem, $pr: 0.25rem) {
content: '\2022';
2020-12-17 10:17:21 +03:00
padding-left: $pl;
padding-right: $pr;
}
2021-12-01 16:49:51 +03:00
h1 + .post-meta {
> span + span::before {
@include dot;
}
em,
time {
@extend %text-highlight;
}
2021-12-04 21:29:40 +03:00
em {
2021-12-04 21:29:40 +03:00
a {
color: inherit;
2020-12-17 10:17:21 +03:00
}
}
}
.post-tail-wrapper {
2023-10-07 23:40:16 +03:00
@extend %text-sm;
2020-07-29 23:58:05 +03:00
margin-top: 6rem;
border-bottom: 1px double var(--main-border-color);
2022-10-19 21:05:29 +03:00
.license-wrapper {
line-height: 1.2rem;
> a {
@extend %text-highlight;
2022-10-19 21:05:29 +03:00
&:hover {
@extend %link-hover;
}
}
span:last-child {
2023-10-07 23:40:16 +03:00
@extend %text-sm;
2022-10-19 21:05:29 +03:00
}
} /* .license-wrapper */
.post-meta a:not(:hover) {
2021-12-04 21:29:40 +03:00
@extend %link-underline;
}
2022-10-19 21:05:29 +03:00
.share-wrapper {
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
2022-10-19 21:05:29 +03:00
user-select: none;
%icon-size {
font-size: 1.125rem;
}
2022-10-19 21:05:29 +03:00
.share-icons {
display: flex;
i {
color: var(--btn-share-color);
@extend %icon-size;
}
2022-10-19 21:05:29 +03:00
> * {
@extend %icon-size;
margin-left: 0.5rem;
&:hover {
i {
@extend %btn-share-hovor;
}
}
}
button {
padding: 0;
border: none;
line-height: inherit;
2022-10-19 21:05:29 +03:00
@extend %cursor-pointer;
}
} /* .share-icons */
} /* .share-wrapper */
2019-12-23 20:21:55 +03:00
}
.share-mastodon {
/* See: https://github.com/justinribeiro/share-to-mastodon#properties */
--wc-stm-font-family: $font-family-base;
--wc-stm-dialog-background-color: var(--card-bg);
--wc-stm-form-button-border: 1px solid var(--btn-border-color);
--wc-stm-form-submit-background-color: var(--sidebar-btn-bg);
--wc-stm-form-cancel-background-color: var(--sidebar-btn-bg);
--wc-stm-form-button-background-color-hover: #007bff;
--wc-stm-form-button-color-hover: white;
font-size: 1rem;
}
2020-04-06 21:11:50 +03:00
.post-tags {
line-height: 2rem;
.post-tag {
&:hover {
@extend %link-hover;
@extend %tag-hover;
@extend %no-bottom-border;
}
}
2020-04-06 21:11:50 +03:00
}
.post-navigation {
2020-02-21 22:15:13 +03:00
.btn {
@extend %btn-post-nav;
&:not(:hover) {
color: var(--link-color);
}
2020-02-25 12:56:03 +03:00
&:hover {
&:not(.disabled)::before {
color: whitesmoke;
}
2020-02-25 12:56:03 +03:00
}
2020-02-25 12:56:03 +03:00
&.disabled {
@extend %btn-post-nav;
2020-02-25 12:56:03 +03:00
pointer-events: auto;
cursor: not-allowed;
background: none;
color: gray;
}
2020-02-25 12:56:03 +03:00
&.btn-outline-primary.disabled:focus {
box-shadow: none;
}
&::before {
color: var(--text-muted-color);
font-size: 0.65rem;
text-transform: uppercase;
content: attr(aria-label);
}
2019-12-23 20:21:55 +03:00
2020-02-25 12:56:03 +03:00
&:first-child {
border-radius: $base-radius 0 0 $base-radius;
2020-10-27 17:08:04 +03:00
left: 0.5px;
2020-02-25 12:56:03 +03:00
}
2020-02-25 12:56:03 +03:00
&:last-child {
border-radius: 0 $base-radius $base-radius 0;
2020-10-27 17:08:04 +03:00
right: 0.5px;
2020-02-25 12:56:03 +03:00
}
}
p {
font-size: 1.1rem;
line-height: 1.5rem;
margin-top: 0.3rem;
white-space: normal;
}
2021-12-30 19:29:25 +03:00
} /* .post-navigation */
@media (hover: hover) {
.post-navigation {
.btn,
.btn::before {
transition: all 0.35s ease-in-out;
}
}
}
@-webkit-keyframes fade-up {
from {
opacity: 0;
position: relative;
top: 2rem;
}
to {
opacity: 1;
position: relative;
top: 0;
}
}
2019-11-24 17:08:17 +03:00
@keyframes fade-up {
from {
opacity: 0;
position: relative;
top: 2rem;
}
2022-10-19 21:05:29 +03:00
2019-11-24 17:08:17 +03:00
to {
opacity: 1;
position: relative;
top: 0;
}
}
#toc-wrapper {
2019-11-15 19:01:33 +03:00
border-left: 1px solid rgba(158, 158, 158, 0.17);
position: -webkit-sticky;
position: sticky;
2020-03-03 15:17:51 +03:00
top: 4rem;
2019-11-15 19:01:33 +03:00
transition: top 0.2s ease-in-out;
-webkit-animation: fade-up 0.8s;
2020-12-18 15:54:18 +03:00
animation: fade-up 0.8s;
2019-11-15 19:01:33 +03:00
ul {
list-style: none;
font-size: 0.85rem;
line-height: 1.25;
padding-left: 0;
li {
&:not(:last-child) {
margin: 0.4rem 0;
}
a {
padding: 0.2rem 0 0.2rem 1.25rem;
}
}
2019-11-15 19:01:33 +03:00
/* Overwrite TOC plugin style */
.toc-link {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover {
color: var(--toc-highlight);
text-decoration: none;
}
&::before {
display: none;
}
}
.is-active-link {
color: var(--toc-highlight) !important;
font-weight: 600;
&::before {
display: inline-block;
width: 1px;
left: -1px;
height: 1.25rem;
background-color: var(--toc-highlight) !important;
}
}
ul {
padding-left: 0.75rem;
2021-09-21 13:00:29 +03:00
}
}
}
/* --- Related Posts --- */
2019-11-15 19:01:33 +03:00
2020-02-21 22:15:13 +03:00
#related-posts {
> h3 {
2020-04-07 15:23:57 +03:00
@include label(1.1rem, 600);
2020-02-25 12:56:03 +03:00
}
2021-10-25 22:04:15 +03:00
time {
@extend %normal-font-style;
2023-10-07 23:40:16 +03:00
@extend %text-xs;
color: var(--text-muted-color);
}
2022-10-19 21:05:29 +03:00
p {
font-size: 0.9rem;
margin-bottom: 0.5rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
2020-02-21 22:15:13 +03:00
.card {
h4 {
@extend %text-clip;
2020-02-21 22:15:13 +03:00
}
}
2019-11-25 15:56:50 +03:00
}
/* stylelint-disable-next-line selector-id-pattern */
#disqus_thread {
min-height: 8.5rem;
}
2021-12-11 12:24:08 +03:00
.utterances {
max-width: 100%;
}
%btn-share-hovor {
color: var(--btn-share-hover-color) !important;
}
2020-02-21 22:15:13 +03:00
.share-label {
2020-04-07 15:23:57 +03:00
@include label(inherit, 400, inherit);
2020-02-25 12:56:03 +03:00
&::after {
content: ':';
2020-02-25 12:56:03 +03:00
}
}
@media all and (max-width: 576px) {
.post-tail-bottom {
flex-wrap: wrap-reverse !important;
2021-10-25 22:04:15 +03:00
> div:first-child {
2020-04-06 21:11:50 +03:00
width: 100%;
margin-top: 1rem;
2020-02-25 12:56:03 +03:00
}
}
}
@media all and (max-width: 768px) {
.content > p > img {
2019-12-23 20:21:55 +03:00
max-width: calc(100% + 1rem);
}
}
/* Hide SideBar and TOC */
@media all and (max-width: 849px) {
.post-navigation {
2020-01-02 19:37:56 +03:00
padding-left: 0;
padding-right: 0;
2021-10-25 22:04:15 +03:00
margin-left: -0.5rem;
margin-right: -0.5rem;
2020-01-02 19:37:56 +03:00
}
2019-12-23 20:21:55 +03:00
}