krata/_sass/layout/post.scss

355 lines
5.6 KiB
SCSS
Raw Normal View History

2021-01-23 06:20:58 +01:00
/*
Post-specific style
*/
2020-02-25 10:56:03 +01:00
@mixin btn-sharing-color($light-color, $important: false) {
@if $important {
color: var(--btn-share-color, $light-color) !important;
2020-02-25 10:56:03 +01:00
} @else {
color: var(--btn-share-color, $light-color);
2020-02-25 10:56:03 +01:00
}
}
@mixin btn-post-nav {
width: 50%;
position: relative;
border-color: var(--btn-border-color);
2020-02-25 10:56:03 +01:00
}
@mixin dot($pl: 0.25rem, $pr: 0.25rem) {
2020-12-17 08:17:21 +01:00
content: "\2022";
padding-left: $pl;
padding-right: $pr;
}
2021-12-01 14:49:51 +01:00
h1 + .post-meta {
span + span::before {
@include dot;
}
em {
color: var(--text-color);
2020-12-17 08:17:21 +01:00
}
}
2020-08-21 16:44:58 +02:00
.post-content {
2020-12-14 08:00:21 +01:00
.preview-img {
@include align-center;
margin-top: 0;
2021-01-29 20:12:43 +01:00
margin-bottom: 2.5rem !important;
}
2019-12-23 18:21:55 +01:00
}
.post-tail-wrapper {
2020-07-29 22:58:05 +02:00
margin-top: 6rem;
border-bottom: 1px double var(--main-border-color);
2019-12-23 18:21:55 +01:00
font-size: 0.85rem;
}
2020-04-06 20:11:50 +02:00
.post-tags {
line-height: 2rem;
}
.post-navigation {
padding-top: 3rem;
2020-06-24 14:47:01 +02:00
padding-bottom: 4rem;
2019-12-23 18:21:55 +01:00
2020-02-21 20:15:13 +01:00
.btn {
2020-02-25 10:56:03 +01:00
@include btn-post-nav;
color: var(--link-color);
2020-02-25 10:56:03 +01:00
&:hover {
background: #2a408e;
color: #fff;
border-color: #2a408e;
}
2020-02-25 10:56:03 +01:00
&.disabled {
@include btn-post-nav;
2020-02-25 10:56:03 +01:00
pointer-events: auto;
cursor: not-allowed;
background: none;
color: gray;
2020-02-25 10:56:03 +01:00
&:hover {
border-color: none;
}
}
2020-02-25 10:56:03 +01:00
&.btn-outline-primary.disabled:focus {
box-shadow: none;
}
&::before {
color: var(--text-muted-color);
font-size: 0.65rem;
text-transform: uppercase;
content: attr(prompt);
}
2019-12-23 18:21:55 +01:00
2020-02-25 10:56:03 +01:00
&:first-child {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
2020-10-27 15:08:04 +01:00
left: 0.5px;
2020-02-25 10:56:03 +01:00
}
2020-02-25 10:56:03 +01:00
&:last-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
2020-10-27 15:08:04 +01:00
right: 0.5px;
2020-02-25 10:56:03 +01:00
}
}
p {
font-size: 1.1rem;
line-height: 1.5rem;
margin-top: 0.3rem;
white-space: normal;
}
2020-02-25 10:56:03 +01:00
} // .post-navigation
2019-11-24 15:08:17 +01:00
@keyframes fade-up {
from {
opacity: 0;
position: relative;
top: 2rem;
}
to {
opacity: 1;
position: relative;
top: 0;
}
}
#toc-wrapper {
2019-11-15 17:01:33 +01:00
border-left: 1px solid rgba(158, 158, 158, 0.17);
position: -webkit-sticky;
position: sticky;
2020-03-03 13:17:51 +01:00
top: 4rem;
2019-11-15 17:01:33 +01:00
transition: top 0.2s ease-in-out;
2020-12-18 13:54:18 +01:00
animation: fade-up 0.8s;
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
&.topbar-down {
top: 6rem;
}
2021-10-25 21:04:15 +02:00
> span {
@include panel-label;
2020-02-25 10:56:03 +01:00
}
2019-11-15 17:01:33 +01:00
}
2021-09-29 11:33:59 +02:00
#toc li a {
2021-09-21 12:00:29 +02:00
font-size: 0.8rem;
2021-04-05 14:02:17 +02:00
&.nav-link:not(.active) {
color: inherit;
}
2021-09-29 11:33:59 +02:00
2019-11-15 17:01:33 +01:00
}
2021-09-21 12:00:29 +02:00
nav[data-toggle=toc] {
.nav {
.nav > li > a.active {
font-weight: 600 !important;
}
}
}
/* --- Related Posts --- */
2019-11-15 17:01:33 +01:00
2020-02-21 20:15:13 +01:00
#related-posts {
> h3 {
2020-04-07 14:23:57 +02:00
@include label(1.1rem, 600);
2020-02-25 10:56:03 +01:00
}
2021-10-25 21:04:15 +02:00
em {
@extend %normal-font-style;
}
2020-02-21 20:15:13 +01:00
.card {
border-color: var(--card-border-color);
2020-02-21 20:15:13 +01:00
background-color: var(--card-bg);
box-shadow: 0 0 5px 0 var(--card-box-shadow);
2020-12-18 13:54:18 +01:00
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
2021-10-25 21:04:15 +02:00
2020-02-21 20:15:13 +01:00
h3 {
2020-04-07 14:23:57 +02:00
color: var(--text-color);
2020-02-21 20:15:13 +01:00
}
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
&:hover {
-webkit-transform: translate3d(0, -3px, 0);
transform: translate3d(0, -3px, 0);
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
2020-02-25 10:56:03 +01:00
}
2020-02-21 20:15:13 +01:00
}
2019-11-15 17:01:33 +01:00
2020-02-21 20:15:13 +01:00
.timeago {
color: var(--relate-post-date);
2020-02-21 20:15:13 +01:00
}
2019-11-15 17:01:33 +01:00
2020-02-21 20:15:13 +01:00
p {
2020-10-27 15:08:04 +01:00
font-size: 0.9rem;
margin-bottom: 0.5rem;
2020-02-21 20:15:13 +01:00
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
2019-11-15 17:01:33 +01:00
2020-02-21 20:15:13 +01:00
a:hover {
text-decoration: none;
}
2019-11-15 17:01:33 +01:00
2020-02-21 20:15:13 +01:00
ul {
list-style-type: none;
padding-inline-start: 1.5rem;
2021-10-25 21:04:15 +02:00
> li::before {
2020-02-25 10:56:03 +01:00
background: #c2c9d4;
width: 5px;
height: 5px;
border-radius: 1px;
display: block;
content: "";
position: relative;
top: 1rem;
right: 1rem;
}
2020-02-21 20:15:13 +01:00
}
2019-11-25 13:56:50 +01:00
}
2021-12-01 14:49:51 +01:00
#tail-wrapper {
2019-11-25 13:56:50 +01:00
min-height: 2rem;
2020-07-29 22:58:05 +02:00
#disqus_thread {
min-height: 7.5rem;
2020-07-29 22:58:05 +02:00
margin-bottom: 2rem;
}
2019-11-25 13:56:50 +01:00
}
.post-tail-bottom a {
color: inherit;
}
%btn-share-hovor {
color: var(--btn-share-hover-color) !important;
}
.share-wrapper {
vertical-align: middle;
user-select: none;
.share-icons {
2020-02-21 20:15:13 +01:00
font-size: 1.2rem;
2021-10-25 21:04:15 +02:00
a {
&:not(:last-child) {
2020-10-27 15:08:04 +01:00
margin-right: 0.25rem;
}
2021-10-25 21:04:15 +02:00
&:hover {
text-decoration: none;
2021-10-25 21:04:15 +02:00
> i {
@extend %btn-share-hovor;
}
}
}
2021-10-25 21:04:15 +02:00
> i {
2021-09-16 11:56:12 +02:00
position: relative;
bottom: 1px;
@extend %cursor-pointer;
&:hover {
@extend %btn-share-hovor;
}
}
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
.fab {
&.fa-twitter {
@include btn-sharing-color(rgba(29, 161, 242, 1));
2020-02-25 10:56:03 +01:00
}
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
&.fa-facebook-square {
@include btn-sharing-color(rgb(66, 95, 156));
}
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
&.fa-telegram {
@include btn-sharing-color(rgb(39, 159, 217));
}
2021-10-25 21:04:15 +02:00
2020-02-25 10:56:03 +01:00
&.fa-weibo {
@include btn-sharing-color(rgb(229, 20, 43));
}
2020-02-21 20:15:13 +01:00
}
} // .share-icons
2020-02-21 20:15:13 +01:00
.fas.fa-link {
2020-02-25 10:56:03 +01:00
@include btn-sharing-color(rgb(171, 171, 171));
2020-02-21 20:15:13 +01:00
}
2020-02-21 20:15:13 +01:00
} // .share-wrapper
.share-label {
2020-04-07 14:23:57 +02:00
@include label(inherit, 400, inherit);
2020-02-25 10:56:03 +01:00
&::after {
content: ":";
}
}
.license-wrapper {
line-height: 1.2rem;
2021-10-25 21:04:15 +02:00
> a {
color: var(--text-color);
2021-10-25 21:04:15 +02:00
2020-04-06 20:11:50 +02:00
&:hover {
@extend %link-hover;
}
2020-02-21 20:15:13 +01:00
}
2020-02-21 20:15:13 +01:00
span:last-child {
2020-10-27 15:08:04 +01:00
font-size: 0.85rem;
2020-02-21 20:15:13 +01:00
}
} // .license-wrapper
@media all and (max-width: 576px) {
.post-tail-bottom {
-ms-flex-wrap: wrap-reverse !important;
flex-wrap: wrap-reverse !important;
2021-10-25 21:04:15 +02:00
> div:first-child {
2020-04-06 20:11:50 +02:00
width: 100%;
margin-top: 1rem;
2020-02-25 10:56:03 +01:00
}
}
}
2019-12-23 18:21:55 +01:00
@media all and (max-width: 768px) {
.post-content > p > img {
2019-12-23 18:21:55 +01:00
max-width: calc(100% + 1rem);
}
}
/* Hide SideBar and TOC */
@media all and (max-width: 830px) {
.post-navigation {
2020-01-02 17:37:56 +01:00
padding-left: 0;
padding-right: 0;
2021-10-25 21:04:15 +02:00
margin-left: -0.5rem;
margin-right: -0.5rem;
2020-01-02 17:37:56 +01:00
}
2019-12-23 18:21:55 +01:00
}