@callstack/rspress-theme
Version:
Callstack theme for Rspress docs
292 lines (246 loc) • 6.51 kB
CSS
/* Nav header */
.rp-nav {
color: var(--rp-c-text-1) ;
}
.rp-doc-layout__sidebar {
/* we want full width sidebar highlights on hover */
padding-left: 0 ;
padding-right: 0 ;
scrollbar-width: thin;
}
/* Nav items */
.rp-sidebar-item,
.rp-sidebar-item--active {
color: var(--rp-c-text-2);
font-size: 14px ;
font-weight: 400;
line-height: 1.5;
border-radius: 0 ;
padding-top: 4px ;
padding-bottom: 4px ;
/* spacing between borders in menu */
margin-top: 0 ;
}
.rp-sidebar-item:hover {
background-color: var(--ck-foreground-primary) ;
}
.rp-sidebar-item--active {
color: var(--rp-c-brand) ;
font-weight: 400 ;
}
/* Section header text */
.rp-sidebar-section-header__left > span {
color: var(--rp-c-text-3) ;
font-family: var(--rp-font-family-mono) ;
font-size: 12px ;
font-weight: 500 ;
line-height: 1.5 ;
text-transform: uppercase;
}
.rp-sidebar-section-header__left > span::before {
content: "//";
color: var(--rp-c-brand) ;
font-size: 12px ;
font-weight: 500 ;
line-height: 1.5 ;
text-transform: uppercase;
margin-right: 6px;
}
/* Sidebar active item disable bg */
.rp-sidebar-item--active {
background-color: transparent ;
}
/* Solid border after sections */
.rp-sidebar-divider {
border-color: transparent ;
}
/* Remove dashed border after sections */
.rp-sidebar-divider--dashed {
display: none ;
}
/* Logo */
img#logo {
max-height: 16px;
}
/* Nav search button */
.rp-search-button {
height: 30px ;
padding: 4px ;
border-radius: var(--rp-radius-small) ;
border: 1px solid var(--rp-c-divider-light) ;
background-color: var(--rp-c-bg) ;
transition: none ;
}
.rp-search-button button > div {
background-color: var(--rp-c-divider-light) ;
}
/* Switch theme button */
.rspress-nav-appearance > div.rp-border {
border: none ;
border-radius: var(--rp-radius-small) ;
padding: 4px ;
display: flex ;
flex-direction: row ;
align-items: center ;
justify-content: center ;
cursor: pointer ;
transition: background 0.15s;
}
.rp-social-links {
gap: 16px ;
}
.rp-nav__others {
gap: 16px ;
}
.rp-social-links__icon > div {
width: 26px ;
height: 26px ;
background: var(--rp-c-divider-light) ;
border: none ;
border-radius: var(--rp-radius-small) ;
padding: 6px ;
margin: -6px ;
cursor: pointer ;
transition: background 0.15s;
}
/* spacing of nav menu items */
.rp-nav-menu,
.rp-nav__right {
gap: 16px ;
}
/* nav menu links */
.rp-nav-menu-item:hover {
color: var(--rp-c-brand) ;
}
/* nav menu active link */
.rp-nav-menu-item--active {
color: var(--rp-c-brand) ;
}
/* mobile nav menu active link */
.rp-nav-screen-menu-item--active {
background-color: transparent ;
}
/* remove arrow from mobile nav menu links */
.rp-nav-screen-menu-item.rp-link[target="_blank"]
.rp-nav-screen-menu-item__left:after {
content: none ;
}
/* remove arrow from nav menu links */
.rp-nav-menu a[target="_blank"]:after {
content: none ;
}
/* mobile search button */
button.rp-nav-hamburger > img {
width: 20px;
height: 20px;
}
.rp-nav-hamburger:hover,
.rp-nav-hamburger--active {
background: none ;
}
/* Social links icon */
div.rspress-nav-appearance > div,
.rp-social-links__icon > div {
color: var(--rp-c-text-1) ;
background: linear-gradient(
to right,
var(--rp-c-brand) 50%,
var(--rp-c-divider-light) 50%
)
right bottom / 200% 100% ;
transition: background-position 0.45s cubic-bezier(0.625, 0.05, 0, 1), color
0.45s cubic-bezier(0.625, 0.05, 0, 1), transform 0.45s
cubic-bezier(0.625, 0.05, 0, 1) ;
}
@media (pointer: fine) {
div.rspress-nav-appearance > div:hover,
.rp-social-links__icon > div:hover {
color: #ffffff ;
background-position: left bottom ;
}
}
.rp-sidebar-menu {
margin-left: -6px ;
}
.rp-sidebar-menu__left > img {
display: none ;
}
.rp-sidebar-menu__left::before {
content: "";
background-image: url("../assets/menu.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
}
.rp-sidebar-menu__left,
.rp-sidebar-menu__right {
font-weight: 500 ;
line-height: 1.5 ;
color: var(--rp-c-text-1) ;
}
.rp-nav__title > a > span {
font-weight: 500 ;
}
/*
========================================
Prev next page
========================================
*/
:root {
--rp-prev-next-page-gap: 12px;
}
.rp-prev-next-page {
gap: var(--rp-prev-next-page-gap);
@media (max-width: 480px) {
flex-direction: column;
}
}
.rp-prev-next-page__item {
width: 100%;
position: relative;
border: 1px solid var(--rp-c-divider-light);
border-radius: var(--rp-radius-small) ;
align-self: stretch;
justify-content: flex-start ;
}
.rp-prev-next-page__item:hover {
background-color: initial ;
opacity: initial ;
}
.rp-prev-next-page__icon {
content: url("../assets/arrow-bar-right.svg?react");
width: 16px;
height: 16px;
padding: calc((40px - 16px) / 2);
background-color: var(--rp-c-divider-light);
border-radius: var(--rp-radius-small);
box-sizing: content-box;
}
.rp-prev-next-page__next {
align-items: flex-start ;
}
.rp-prev-next-page__item__desc {
position: absolute;
top: 10px;
left: var(--rp-prev-next-page-gap);
}
.rp-prev-next-page__next .rp-prev-next-page__item__desc {
padding-left: 0;
}
.rp-prev-next-page__prev .rp-prev-next-page__item__desc {
padding-left: calc(40px + var(--rp-prev-next-page-gap));
}
.rp-prev-next-page__prev .rp-prev-next-page__item__title {
justify-content: flex-start;
}
.rp-prev-next-page__item__title {
gap: var(--rp-prev-next-page-gap) ;
justify-content: space-between;
width: 100%;
align-items: flex-start ;
}
.rp-prev-next-page__item__title > span {
padding-top: var(--rp-prev-next-page-gap);
}