2022-10-12 16:44:05 +00:00
|
|
|
.citizen-toc {
|
|
|
|
font-size: 0.875rem;
|
2022-10-25 20:42:19 +00:00
|
|
|
line-height: var( --line-height-xs );
|
2022-10-12 16:44:05 +00:00
|
|
|
|
2022-10-19 17:30:04 +00:00
|
|
|
&__card {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2022-11-01 00:34:00 +00:00
|
|
|
gap: var( --space-xs );
|
2022-10-19 17:30:04 +00:00
|
|
|
}
|
|
|
|
|
2022-10-19 19:55:28 +00:00
|
|
|
&__top {
|
2023-02-28 21:59:36 +00:00
|
|
|
&::before {
|
2022-10-19 19:55:28 +00:00
|
|
|
width: 0.875rem;
|
|
|
|
height: 0.875rem;
|
2022-10-19 19:56:17 +00:00
|
|
|
content: '';
|
2022-10-19 19:55:28 +00:00
|
|
|
opacity: var( --opacity-icon-base );
|
|
|
|
}
|
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
&:hover::before {
|
2022-10-19 19:55:28 +00:00
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
}
|
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
&:active::before {
|
2022-10-19 19:55:28 +00:00
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:30:04 +00:00
|
|
|
&__header {
|
|
|
|
color: var( --color-base--subtle );
|
2022-10-28 03:26:52 +00:00
|
|
|
letter-spacing: 0.05em;
|
2022-10-12 16:44:05 +00:00
|
|
|
}
|
|
|
|
|
2022-10-19 17:34:37 +00:00
|
|
|
&__contents {
|
|
|
|
margin-left: 1px;
|
|
|
|
}
|
|
|
|
|
2022-10-12 16:44:05 +00:00
|
|
|
&__contents,
|
|
|
|
&__list {
|
|
|
|
border-left: 1px solid var( --border-color-base );
|
2022-11-15 15:43:56 +00:00
|
|
|
margin: 0;
|
2022-10-12 16:44:05 +00:00
|
|
|
list-style: none;
|
2022-10-19 17:30:04 +00:00
|
|
|
|
|
|
|
.citizen-toc__link {
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__list {
|
2022-11-01 00:34:00 +00:00
|
|
|
margin-left: var( --space-xs );
|
2022-10-12 16:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__link {
|
|
|
|
display: flex;
|
2022-11-01 00:34:00 +00:00
|
|
|
padding-top: var( --space-xs );
|
|
|
|
padding-bottom: var( --space-xs );
|
2022-10-19 17:30:04 +00:00
|
|
|
border-radius: var( --border-radius--small );
|
2022-10-12 16:44:05 +00:00
|
|
|
color: var( --color-base );
|
2022-10-23 23:40:19 +00:00
|
|
|
font-weight: var( --font-weight-medium );
|
2022-11-01 00:34:00 +00:00
|
|
|
gap: var( --space-xs );
|
2022-10-19 17:30:04 +00:00
|
|
|
|
2022-10-19 19:24:02 +00:00
|
|
|
&.citizen-toc__top {
|
|
|
|
height: 0;
|
2022-10-20 01:09:50 +00:00
|
|
|
padding-top: 0;
|
|
|
|
padding-bottom: 0;
|
2022-10-19 19:24:02 +00:00
|
|
|
opacity: 0;
|
2022-10-20 01:09:50 +00:00
|
|
|
transition: @transition-opacity, @transition-height, padding @transition-timing-slow ease;
|
2022-10-19 19:24:02 +00:00
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:30:04 +00:00
|
|
|
&:hover {
|
|
|
|
background-color: var( --background-color-quiet--hover );
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background-color: var( --background-color-quiet--active );
|
|
|
|
}
|
2023-06-15 18:37:07 +00:00
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2022-10-12 16:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__indicator {
|
|
|
|
width: 3px;
|
|
|
|
flex-shrink: 0;
|
2022-11-15 16:21:04 +00:00
|
|
|
border-radius: var( --border-radius--pill );
|
2022-10-12 16:44:05 +00:00
|
|
|
margin-left: -2px;
|
|
|
|
}
|
|
|
|
|
2022-10-19 21:03:48 +00:00
|
|
|
&__text {
|
|
|
|
display: flex;
|
2022-11-01 00:34:00 +00:00
|
|
|
gap: var( --space-xs );
|
2022-10-19 21:03:48 +00:00
|
|
|
}
|
|
|
|
|
2022-10-12 16:44:05 +00:00
|
|
|
&__numb {
|
|
|
|
display: none;
|
2022-10-19 21:03:48 +00:00
|
|
|
color: var( --color-base--subtle );
|
2022-10-12 16:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__listItem {
|
|
|
|
&--active {
|
|
|
|
> .citizen-toc__link {
|
|
|
|
color: var( --color-primary );
|
|
|
|
|
|
|
|
.citizen-toc__indicator {
|
|
|
|
background-color: var( --color-primary );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-19 19:24:02 +00:00
|
|
|
// Sticky header styles
|
|
|
|
.citizen-body-header--sticky {
|
|
|
|
.citizen-toc__top.citizen-toc__link {
|
2023-03-01 21:08:07 +00:00
|
|
|
height: 2rem; // 1rem text + 1rem padding
|
2022-11-01 00:34:00 +00:00
|
|
|
padding-top: var( --space-xs );
|
|
|
|
padding-bottom: var( --space-xs );
|
2022-10-19 19:24:02 +00:00
|
|
|
opacity: 1;
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-19 19:55:28 +00:00
|
|
|
.skin-citizen-dark {
|
2023-02-28 21:59:36 +00:00
|
|
|
.citizen-toc__top::before {
|
2022-10-19 19:55:28 +00:00
|
|
|
filter: invert( 1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-10 21:11:37 +00:00
|
|
|
// Move down when site header is hidden
|
|
|
|
@media ( max-width: ( @width-breakpoint-tablet ) ) {
|
|
|
|
.citizen-toc {
|
|
|
|
transition: @transition-transform;
|
2022-12-06 20:46:14 +00:00
|
|
|
will-change: transform;
|
2022-11-10 21:11:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.citizen-scroll--down .citizen-toc {
|
|
|
|
transform: translateY( var( --header-size ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-20 01:09:50 +00:00
|
|
|
@media ( max-width: ( @width-breakpoint-desktop - 1px ) ) {
|
|
|
|
.citizen-toc {
|
|
|
|
position: fixed;
|
2022-11-16 22:49:01 +00:00
|
|
|
z-index: @z-index-page-header;
|
2022-10-20 01:09:50 +00:00
|
|
|
right: 0;
|
2022-11-01 00:34:00 +00:00
|
|
|
bottom: ~'calc( var( --header-size ) + var( --space-xs ) )';
|
2022-10-23 23:40:19 +00:00
|
|
|
// Allow click through
|
|
|
|
pointer-events: none;
|
2022-10-20 01:09:50 +00:00
|
|
|
|
|
|
|
&__card {
|
|
|
|
overflow: auto;
|
|
|
|
// This is not bulletproof since it will get covered by page header
|
|
|
|
// in extremely short height. but it should be good for now
|
|
|
|
max-height: ~'calc( var( --header-card-maxheight ) - 8rem )';
|
|
|
|
padding: var( --space-md );
|
2022-11-01 00:34:00 +00:00
|
|
|
margin: var( --space-xs );
|
2022-10-20 01:09:50 +00:00
|
|
|
overscroll-behavior: contain;
|
2023-05-23 16:47:26 +00:00
|
|
|
-webkit-user-select: none;
|
2022-10-20 01:09:50 +00:00
|
|
|
user-select: none;
|
|
|
|
.citizen-card;
|
|
|
|
.citizen-card-hide( bottom right, '', false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#citizen-toc {
|
|
|
|
&__checkbox:checked {
|
|
|
|
~ .citizen-toc__card {
|
|
|
|
.citizen-card-show( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__buttonCheckbox {
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
2022-11-04 22:43:50 +00:00
|
|
|
display: grid;
|
2022-10-20 01:09:50 +00:00
|
|
|
width: 2.5rem;
|
|
|
|
height: 2.5rem;
|
|
|
|
border-radius: var( --border-radius--medium );
|
2022-11-01 00:34:00 +00:00
|
|
|
margin: var( --space-xs );
|
2022-10-20 01:09:50 +00:00
|
|
|
background-color: var( --color-surface-1 );
|
|
|
|
box-shadow: var( --box-shadow-dialog );
|
2022-11-04 22:43:50 +00:00
|
|
|
place-content: center;
|
2022-10-23 23:40:19 +00:00
|
|
|
pointer-events: auto;
|
2022-10-20 01:27:03 +00:00
|
|
|
transform: none;
|
|
|
|
transform-origin: bottom right;
|
|
|
|
transition: @transition-transform;
|
2022-10-20 01:09:50 +00:00
|
|
|
|
2022-11-04 22:43:50 +00:00
|
|
|
.citizen-ui-icon {
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
2022-10-20 01:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// The hover state colors are not great but it will do for now
|
|
|
|
&:hover {
|
|
|
|
background-color: var( --color-surface-3 );
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background-color: var( --color-surface-1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-20 01:27:03 +00:00
|
|
|
// Hide dismiss button when JS is enabled
|
|
|
|
// Since clicking outside will dismiss ToC already
|
|
|
|
.client-js {
|
|
|
|
#citizen-toc {
|
|
|
|
&__checkbox:checked {
|
|
|
|
// Fake seamless transition
|
|
|
|
~ #citizen-toc__buttonCheckbox {
|
|
|
|
background-color: transparent;
|
|
|
|
box-shadow: none;
|
|
|
|
pointer-events: none;
|
|
|
|
transform: scale( 1.2 );
|
|
|
|
|
2022-11-04 22:43:50 +00:00
|
|
|
.citizen-ui-icon {
|
2022-10-20 01:27:03 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-20 01:09:50 +00:00
|
|
|
// Wait for first paint before animating
|
|
|
|
.citizen-animations-ready {
|
|
|
|
.citizen-toc__card {
|
|
|
|
.citizen-card-transition();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-06 20:40:30 +00:00
|
|
|
@media ( min-width: @width-breakpoint-desktop ) {
|
|
|
|
.citizen-toc {
|
|
|
|
grid-area: toc;
|
2022-10-12 16:44:05 +00:00
|
|
|
|
|
|
|
&__card {
|
2022-11-01 00:34:00 +00:00
|
|
|
--toc-margin-top: var( --space-xs );
|
2022-10-12 16:44:05 +00:00
|
|
|
position: sticky;
|
2022-10-19 17:30:04 +00:00
|
|
|
top: var( --toc-margin-top );
|
2023-01-12 20:58:40 +00:00
|
|
|
max-height: ~'calc( 100vh - var( --toc-margin-top ) - var( --space-md ) )';
|
2022-10-19 17:30:04 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overscroll-behavior: contain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 22:43:50 +00:00
|
|
|
// Hide button in desktop viewport
|
|
|
|
#citizen-toc__buttonCheckbox {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-10-19 17:30:04 +00:00
|
|
|
// Sticky header styles
|
|
|
|
.citizen-body-header--sticky {
|
|
|
|
.citizen-toc__card {
|
2022-11-01 00:34:00 +00:00
|
|
|
--toc-margin-top: ~'calc( var( --header-size ) + var( --space-xxl ) )';
|
2022-10-19 17:30:04 +00:00
|
|
|
|
|
|
|
// Sticky header is shorter without buttons
|
|
|
|
@media ( max-height: 800px ) {
|
|
|
|
--toc-margin-top: ~'calc( var( --header-size ) + var( --space-md ) )';
|
|
|
|
}
|
2022-10-12 16:44:05 +00:00
|
|
|
}
|
2022-10-06 20:40:30 +00:00
|
|
|
}
|
2022-10-06 20:31:55 +00:00
|
|
|
}
|