DiscoTOC/common/common.scss

356 lines
7.1 KiB
SCSS
Raw Normal View History

2019-03-08 21:06:56 -05:00
@import "common/foundation/variables";
.d-toc-regular {
2019-03-08 21:08:44 -05:00
[data-theme-toc] {
2019-03-08 21:09:32 -05:00
display: none;
2019-03-08 21:08:44 -05:00
}
2019-03-08 21:06:56 -05:00
.d-toc-ignore {
font-size: $font-up-1;
margin: 0 0 10px 0;
font-weight: bold;
}
.highlighted {
animation: fadein 1s;
}
.d-toc {
transform: translate3d(0, 0, 0);
transition: opacity 0.25s;
ul,
li {
list-style: none;
margin: 0;
padding: 0;
border: none;
}
.d-toc-item {
2019-04-14 16:47:22 -04:00
padding: 6px 0;
2019-03-08 21:06:56 -05:00
a {
2020-08-25 11:58:15 -04:00
color: var(--primary-high, $primary-high);
2019-03-08 21:06:56 -05:00
}
&.d-toc-active {
position: relative;
&:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2020-08-25 11:58:15 -04:00
border-left: 1px solid var(--tertiary, $tertiary);
2019-03-08 21:54:08 -05:00
}
.rtl & {
2020-08-25 11:58:15 -04:00
border-right: 1px solid var(--tertiary, $tertiary);
2019-03-08 21:54:08 -05:00
}
2019-03-08 21:06:56 -05:00
height: 100%;
content: "";
width: 1px;
position: absolute;
top: 0;
}
a {
2020-08-25 11:58:15 -04:00
color: var(--primary, $primary);
text-shadow: 0.1px 0.1px var(--primary, $primary),
-0.1px -0.1px var(--primary, $primary);
2019-03-08 21:06:56 -05:00
}
}
}
.d-toc-heading {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
padding-left: 10px;
}
.rtl & {
padding-right: 10px;
}
2019-03-08 21:06:56 -05:00
.d-toc-active:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
left: -10px;
}
.rtl & {
right: -10px;
}
2019-03-08 21:06:56 -05:00
}
}
.d-toc-subheading {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
padding-left: 20px;
}
.rtl & {
padding-right: 20px;
}
2019-03-08 21:06:56 -05:00
.d-toc-active:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
left: -30px;
}
.rtl & {
right: -30px;
}
2019-03-08 21:06:56 -05:00
}
.d-toc-subheading {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
padding-left: 30px;
}
.rtl & {
padding-right: 30px;
}
2019-03-08 21:06:56 -05:00
.d-toc-active:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
left: -60px;
}
.rtl & {
right: -60px;
}
2019-03-08 21:06:56 -05:00
}
.d-toc-subheading {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
padding-left: 40px;
}
.rtl & {
padding-right: 40px;
}
2019-03-08 21:06:56 -05:00
.d-toc-active:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
left: -70px;
}
.rtl & {
right: -70px;
}
2019-03-08 21:06:56 -05:00
}
.d-toc-subheading {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
padding-left: 50px;
}
.rtl & {
padding-right: 50px;
}
2019-03-08 21:06:56 -05:00
.d-toc-active:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
left: -80px;
}
.rtl & {
right: -80px;
}
2019-03-08 21:06:56 -05:00
}
}
}
}
}
.d-toc-subheading li {
2019-03-08 21:54:08 -05:00
font-size: 0.8em;
2019-03-08 21:06:56 -05:00
}
}
2019-04-14 16:47:22 -04:00
.d-toc-post-heading {
.d-toc-anchor-link {
font-size: initial;
color: transparent;
transition: color 0.15s linear;
:not(.rtl) & {
margin-left: 5px;
}
.rtl & {
margin-right: 5px;
}
2019-03-08 21:54:08 -05:00
}
2019-04-14 16:47:22 -04:00
&:hover .d-toc-anchor-link {
2020-08-25 11:58:15 -04:00
color: var(--primary-medium, $primary-medium);
opacity: 0.6;
2019-03-08 21:54:08 -05:00
}
2019-03-08 21:06:56 -05:00
}
#bottom-anchor {
opacity: 0;
height: 0;
margin: 0;
}
.post-bottom-wrapper {
2021-05-10 10:02:45 -04:00
padding: 1em 0.5em 0 0.5em;
a {
color: var(--primary-med-or-secondary-med);
}
}
.d-toc {
margin-top: 1em;
}
2019-03-08 21:06:56 -05:00
}
// large screens
@media screen and (min-width: $large-width) {
2019-03-08 21:08:44 -05:00
.d-toc-toggle {
display: none !important;
}
2019-03-08 21:06:56 -05:00
.d-toc-close-wrapper,
.d-toc-subheading {
display: none;
}
.d-toc-post {
.topic-body,
.topic-avatar {
2019-03-08 21:06:56 -05:00
border-top: none;
}
.d-toc {
max-height: 85vh;
padding-left: 0;
2019-04-14 16:47:22 -04:00
position: -webkit-sticky;
2019-03-08 21:06:56 -05:00
position: sticky;
top: 75px;
margin-bottom: 135px;
max-width: 235px;
2019-03-08 21:06:56 -05:00
overflow-y: auto;
overflow-x: hidden;
align-self: flex-start;
flex: 1 1 auto;
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 22:01:21 -05:00
margin-left: -1px;
}
.rtl & {
margin-right: -1px;
}
2019-03-08 21:06:56 -05:00
}
.d-toc-article {
display: flex;
2019-04-14 16:47:22 -04:00
.post-notice {
display: none;
}
.topic-map {
margin-bottom: 0;
}
2019-03-08 21:06:56 -05:00
> .row {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2020-08-25 11:58:15 -04:00
border-right: 1px solid var(--primary-low, $primary-low);
2019-03-08 21:54:08 -05:00
}
.rtl & {
2020-08-25 11:58:15 -04:00
border-left: 1px solid var(--primary-low, $primary-low);
2019-03-08 21:54:08 -05:00
}
2019-03-08 21:06:56 -05:00
}
}
#topic-title {
margin-bottom: 0;
.title-wrapper {
2020-08-25 11:58:15 -04:00
border-bottom: 1px solid var(--primary-low, $primary-low);
2019-03-08 21:06:56 -05:00
padding-bottom: 0.5em;
width: auto;
}
}
}
}
// small screens
@media screen and (max-width: $large-width) {
.d-toc-regular {
.post-bottom-wrapper {
display: none;
}
2019-03-08 21:06:56 -05:00
#d-toc {
z-index: z("header") + 1;
2020-08-25 11:58:15 -04:00
background: var(--secondary, $secondary);
2019-03-08 21:06:56 -05:00
position: fixed;
right: 0;
top: 0;
2019-03-08 22:01:21 -05:00
2019-03-08 21:06:56 -05:00
height: 100vh;
width: 100vw;
max-width: 500px;
overflow: scroll;
transition: transform 0.5s, opacity 0.25s;
transform: translatex(100%);
opacity: 0;
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 22:01:21 -05:00
margin-left: -1px;
}
.rtl & {
margin-right: -1px;
}
2019-03-08 21:06:56 -05:00
&.d-toc-mobile {
transform: translatex(0);
opacity: 1;
}
.d-toc-active {
&:before {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
margin-left: -1px;
}
.rtl & {
margin-right: -1px;
}
2019-03-08 21:06:56 -05:00
}
}
}
.d-toc-close-wrapper {
height: 3em;
2020-08-25 11:58:15 -04:00
background: var(--secondary, $secondary);
2019-03-08 21:54:08 -05:00
2019-03-08 21:06:56 -05:00
margin-bottom: 1em;
2019-04-14 16:47:22 -04:00
position: -webkit-sticky;
2019-03-08 21:06:56 -05:00
position: sticky;
top: 0;
display: flex;
align-items: center;
justify-content: flex-end;
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 22:01:21 -05:00
padding-right: 1em;
}
.rtl & {
padding-left: 1em;
}
2019-03-08 21:06:56 -05:00
}
.d-toc-toggle {
position: fixed;
bottom: 5px;
2019-03-08 22:01:21 -05:00
padding: 0.5em 1em;
2020-08-25 11:58:15 -04:00
background: var(--tertiary, $tertiary);
color: var(--secondary, $secondary);
2019-03-08 22:01:21 -05:00
z-index: 3;
margin-bottom: env(safe-area-inset-bottom);
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
right: 16px;
}
.rtl & {
left: 16px;
}
body.footer-nav-visible & {
bottom: 49px;
}
2019-03-08 21:06:56 -05:00
}
#d-toc > ul {
2019-03-08 22:05:58 -05:00
:not(.rtl) & {
2019-03-08 21:54:08 -05:00
margin-left: 20px;
2020-08-25 11:58:15 -04:00
border-left: 1px solid var(--primary-low, $primary-low);
2019-03-08 21:54:08 -05:00
}
.rtl & {
margin-right: 20px;
2020-08-25 11:58:15 -04:00
border-right: 1px solid var(--primary-low, $primary-low);
2019-03-08 21:54:08 -05:00
}
2019-03-08 21:06:56 -05:00
&:last-child {
margin-bottom: 5em;
}
}
}
}
2019-03-08 21:08:44 -05:00
2019-04-14 16:47:22 -04:00
.d-toc-timeline {
.timeline-container,
#topic-progress-wrapper {
opacity: 0;
pointer-events: none;
2019-04-14 17:30:59 -04:00
transition: opacity 0.25s;
2019-04-14 16:47:22 -04:00
}
&.d-toc-timeline-visible {
.timeline-container,
#topic-progress-wrapper {
opacity: 1;
pointer-events: initial;
}
}
}
.edit-title .d-editor-preview [data-theme-toc] {
2020-08-25 11:58:15 -04:00
background: var(--tertiary, $tertiary);
color: var(--secondary, $secondary);
border-top: 2px solid var(--secondary, $secondary);
2019-04-14 16:47:22 -04:00
position: -webkit-sticky;
2019-03-08 21:08:44 -05:00
position: sticky;
top: 0;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
2019-04-14 16:47:22 -04:00
&:before {
content: "#{$composer_toc_text}";
}
2019-03-08 21:08:44 -05:00
}