Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the design for the documentation #376

Merged
merged 11 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ const config = {
customCss: [
require.resolve("@code-hike/mdx/styles.css"),
require.resolve("./src/css/custom.css"),
]},
require.resolve("./src/css/new-design.css"),
],
},
}),

],
redocusaurus,
],
Expand Down
380 changes: 380 additions & 0 deletions src/css/new-design.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,380 @@
@import url("https://rsms.me/inter/inter.css");

:root {
--ifm-font-family-base: "Inter", sans-serif;
--ifm-code-font-size: 0.85rem;
}

/* level 1 in sidebar */
.theme-doc-sidebar-item-category-level-1,
.theme-doc-sidebar-item-link-level-1 {
font-size: 1rem !important;
font-weight: 600 !important;
letter-spacing: 0.05rem !important;
}
.theme-doc-sidebar-item-category-level-1 > .menu__link--active {
}

/* level 2 in sidebar */
.theme-doc-sidebar-item-link-level-2,
.theme-doc-sidebar-item-category-level-2 {
font-size: 1rem !important;
letter-spacing: 0rem !important;
}
.theme-doc-sidebar-item-link-level-2 > .menu__link--active,
.theme-doc-sidebar-item-category-level-2 > .menu__link--active {
font-weight: 500 !important;
}
.theme-doc-sidebar-item-category-level-2
> .menu__list-item-collapsible
> .menu__link--active {
font-weight: 500 !important;
}

/* level 3 in sidebar */
.theme-doc-sidebar-item-link-level-3 {
font-size: 1rem !important;
}
.theme-doc-sidebar-item-link-level-3 > .menu__link--active {
font-weight: 500 !important;
}

/* each block of category */
.theme-doc-sidebar-item-category.theme-doc-sidebar-item-category-level-1,
.theme-doc-sidebar-item-link-level-1 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.theme-doc-sidebar-item-category.theme-doc-sidebar-item-category-level-2 {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}

/* border between categories in sidebar */
.theme-doc-sidebar-item-link.theme-doc-sidebar-item-link-level-1 > hr {
display: none;
}

/* chevron in sidebar*/
.menu__link--sublist::after,
.menu__caret::before {
width: 1.5rem !important;
min-width: 1.5rem !important;
height: 1.5rem !important;
background-size: contain;
}

/* add space to top of pages */
main nav {
margin-bottom: 3rem !important;
margin-top: 1rem !important;
}

/* typography hierarchy */
h1 {
font-weight: 700 !important;
font-size: 2rem !important;
}
h2 {
font-weight: 700 !important;
font-size: 1.5rem !important;
}
h3 {
font-weight: 700 !important;
font-size: 1rem !important;
}

/* add spacing to pictures*/
img {
margin-top: 0rem;
margin-bottom: 1.5rem;
}

/* code editor */

.ch-codegroup,
.ch-codeblock {
--ch-t-editorGroupHeader-tabsBackground: #f0f2f2 !important;
box-shadow: none !important;
border: 4px solid var(--ch-t-editorGroupHeader-tabsBackground);
border-left-width: 2px !important;
border-right-width: 2px !important;
border-top-width: 2px !important;
border-bottom-width: 2px !important;
}
.ch-editor-tab {
--ch-t-tab-inactiveBackground: var(
--ch-t-editorGroupHeader-tabsBackground
) !important;

border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.ch-editor-tab > div {
font-size: 0.85rem !important;
}
.ch-editor-tab[data-active="false"] {
border-color: transparent;
}

/* steps number */

*[class*="circle"],
*[class*="circleSubtle"] {
background-color: var(--ch-t-background) !important;
border: 2px solid var(--ifm-color-secondary) !important;
font-weight: 700 !important;
font-size: 1rem !important;
padding: 0.4rem !important;
width: 2.3rem !important;
height: 2.3rem !important;
color: inherit !important;
margin-left: -0.2rem;
}
*[class*="stephead"] {
padding-left: calc(var(--ifm-spacing-horizontal) - 0.25rem);
}

/* make top tabs sticky */
.tablist {
font-weight: 500 !important;
}
.tabs {
font-weight: 500 !important;
margin-bottom: 2rem !important;
}

@media (min-width: 996px) {
header + * + .tabs-container {
position: sticky;
top: 29px;
background-color: transparent !important;
z-index: 999999;
}
}
.tabs__item {
border-bottom-width: 2px !important;
}

/* call-outs style */
.theme-admonition {
border-left-width: 2px !important;
border-right-width: 2px !important;
border-top-width: 2px !important;
border-bottom-width: 2px !important;
box-shadow: none;
}
.alert {
--ifm-alert-border-color: rgba(230, 167, 0, 0.25);
}
.alert--success {
--ifm-alert-border-color: rgba(0, 148, 0, 0.1);
}
.alert--info {
--ifm-alert-border-color: rgba(76, 179, 212, 0.15);
}
.alert--secondary {
--ifm-alert-border-color: #a27dff4a;
background-color: #a27dff0e;
}
/* remove shadow from grey boxes like logs*/
.grey-details,
details {
--ifm-alert-border-color: rgba(76, 179, 212, 0.15);
box-shadow: none !important;
border-left-width: 2px !important;
border-right-width: 2px !important;
border-top-width: 2px !important;
border-bottom-width: 2px !important;
border-color: var(--ifm-alert-border-color) !important;
}

/* next and previous links*/
.pagination-nav__link {
border: none !important;
}

/* feature cards*/
*[class*="featureDiv"] {
border-width: 2px !important;
border-color: #f0f2f2 !important;
padding: 0.5rem !important;
padding-top: 2rem !important;
box-shadow: none !important;
border-radius: 0.25rem;
height: 100%;
}
.card {
border-width: 2px !important;
border-color: #f0f2f2 !important;
padding: 1.5rem !important;
box-shadow: none !important;
border-radius: 0.25rem;
}
.card:hover {
background-color: rgba(0, 0, 0, 0.03);
}
.card h2 {
font-size: 1.25rem !important;
}
.card p {
font-size: 1rem !important;
}

.navbar__logo {
height: 28px;
}

/* layout change*/
@supports selector(:has(*)) {
aside {
width: auto !important;
flex-grow: 1;
border: none !important;
background-color: transparent !important;
min-width: 240px;
}
main {
width: auto !important;
}
*[class*="sidebarViewport"] {
display: flex;
justify-content: flex-end;
}

*[class*="docRoot"]:not(:has([class*="tableOfContents"])) {
display: grid !important;
grid-template-columns: 1fr minmax(auto, min(1200px, calc(100vw - 480px))) 1fr;
}
@media (max-width: 996px) {
*[class*="docRoot"]:not(:has([class*="tableOfContents"])) {
grid-template-columns: 1fr !important;
}
}
*[class*="docRoot"]:not(:has([class*="tableOfContents"])) main {
padding-left: 3rem;
padding-right: 3rem;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) {
display: grid !important;
grid-template-columns: 1fr minmax(auto, 1200px) 1fr;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) main {
display: contents !important;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) main article {
padding-left: 3rem;
padding-right: 3rem;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) main article + nav {
padding-left: 3rem;
padding-right: 3rem;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) main > .container {
display: contents !important;
}
*[class*="docRoot"]:has([class*="tableOfContents"]) main > .container > .row {
display: contents !important;
}
*[class*="docRoot"]:has([class*="tableOfContents"])
main
> .container
> .row
> .col {
max-width: 100% !important;
min-width: 0px;
}
*[class*="docRoot"]:has([class*="tableOfContents"])
main
> .container
> .row
> .col:last-child {
min-width: 240px;
}

div:has(> *[class*="tableOfContents"]) {
background-color: transparent !important;
padding-left: 0rem;
padding-right: 0rem;
}
.main-wrapper {
background-color: #f2f0fa96 !important;
}
@media (min-width: 0px) {
main[class*="docMainContainer"] {
max-width: 100vw !important;
}
}

main .container {
padding-top: 0px !important;
margin-left: 0px !important;
margin-right: 0px !important;
padding-bottom: 0px !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
main .container > * {
height: 100%;
}
main:not(:has(.table-of-contents)) .container > * > * {
max-width: 100% !important;
}
main:not(:has(.table-of-contents)) {
background-color: white;
}
main:has(.table-of-contents) .container > * > * {
background-color: white;
padding-left: 0px !important;
padding-right: 0px !important;
}

.table-of-contents__left-border {
border: none;
}
.table-of-contents {
font-size: 0.875rem;
}
.table-of-contents__link--active {
font-weight: 500;
}
}

/* first time features */
*[class*="featureFirstTime"][class*="featureFirstTime"],
*[class*="featureFamiliar"][class*="featureFamiliar"] {
padding: 1rem;
padding-top: 3rem !important;
height: 100%;
margin-top: 0px;
}
*[class*="featureFirstTime"][class*="featureFirstTime"]:hover,
*[class*="featureFamiliar"][class*="featureFamiliar"]:hover {
border-width: 2px !important;
}

*[class*="featureFirstTime"] {
border-color: #a27dff4a !important;
background-color: #a27dff0e !important;
}
*[class*="featureFirstTime"] *[class*="circleFirstTime"] {
border-color: #a27dff4a !important;
background-color: white !important;
border-width: 2px !important;
width: 2.5rem;
height: 2.5rem;
margin-top: -1.1rem;
}

*[class*="featureFamiliar"] {
border-color: rgba(76, 179, 212, 0.15) !important;
background-color: var(--ifm-color-info-contrast-background) !important;
}
*[class*="featureFamiliar"] *[class*="circleFamiliar"] {
border-color: #a27dff4a !important;
background-color: white !important;
border-width: 2px !important;
width: 2.5rem;
height: 2.5rem;
margin-top: -1.1rem;
}
Loading