From adaa7b757e322e5676f5932d658a2cb765d4d44a Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Thu, 13 Jan 2022 15:56:30 +1100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20site=20search=20powered=20by?= =?UTF-8?q?=20Fuse.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + assets/css/compiled/main.css | 909 +++++++++++++++++------- assets/css/main.css | 8 + assets/css/schemes/avocado.css | 62 +- assets/css/schemes/congo.css | 62 +- assets/css/schemes/fire.css | 62 +- assets/css/schemes/ocean.css | 62 +- assets/css/schemes/slate.css | 62 +- assets/icons/search.svg | 1 + assets/icons/times.svg | 1 + assets/js/search.js | 159 +++++ assets/lib/fuse/fuse.min.js | 9 + config/_default/config.toml | 3 + config/_default/params.toml | 1 + exampleSite/config/_default/config.toml | 3 + exampleSite/config/_default/params.toml | 1 + i18n/de.yaml | 5 + i18n/en.yaml | 5 + i18n/es.yaml | 5 + i18n/fr.yaml | 5 + i18n/pt-BR.yaml | 5 + i18n/zh.yaml | 5 + layouts/_default/baseof.html | 7 +- layouts/_default/index.json | 6 + layouts/partials/header.html | 13 + layouts/partials/search.html | 52 ++ package-lock.json | 18 +- package.json | 5 + tailwind.config.js | 89 +-- 29 files changed, 1169 insertions(+), 457 deletions(-) create mode 100644 assets/icons/search.svg create mode 100644 assets/icons/times.svg create mode 100644 assets/js/search.js create mode 100644 assets/lib/fuse/fuse.min.js create mode 100644 layouts/_default/index.json create mode 100644 layouts/partials/search.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 3021f6ce..e3abfcf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Multilingual support - Right-to-left (RTL) language support +- Site search powered by Fuse.js - Automatic Markdown image resizing and srcset generation - Performance and Accessibility improvements to achieve perfect Lighthouse scores - Author `headline` parameter diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index f6569857..d8747a57 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -16,7 +16,7 @@ /* 2 */ border-style: solid; /* 2 */ - border-color: currentColor; + border-color: #e5e7eb; /* 2 */ } @@ -469,7 +469,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose { - color: var(--color-neutral-700); + color: rgb(var(--color-neutral-700)); max-width: 65ch; } @@ -482,22 +482,22 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose a { - color: var(--color-primary-700); + color: rgb(var(--color-primary-700)); text-decoration: underline; font-weight: 500; - -webkit-text-decoration-color: var(--color-primary-300); - text-decoration-color: var(--color-primary-300); + -webkit-text-decoration-color: rgb(var(--color-primary-300)); + text-decoration-color: rgb(var(--color-primary-300)); } :where(.prose a:hover):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral) !important; + color: rgb(var(--color-neutral)) !important; text-decoration: none !important; - background-color: var(--color-primary-600) !important; + background-color: rgb(var(--color-primary-600)) !important; border-radius: 0.09rem; } .prose :where(strong):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-900); + color: rgb(var(--color-neutral-900)); font-weight: 600; } @@ -557,7 +557,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(hr):not(:where([class~="not-prose"] *)) { - border-color: var(--color-neutral-200); + border-color: rgb(var(--color-neutral-200)); border-top-width: 1px; margin-top: 3em; margin-bottom: 3em; @@ -566,14 +566,14 @@ Ensure the default browser behavior of the `hidden` attribute. .prose :where(blockquote):not(:where([class~="not-prose"] *)) { font-weight: 500; font-style: italic; - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); border-left-width: 0.25rem; - border-left-color: var(--color-primary-200); + border-left-color: rgb(var(--color-primary-200)); quotes: "\201C""\201D""\2018""\2019"; margin-top: 1.6em; margin-bottom: 1.6em; padding-left: 1em; - border-right-color: var(--color-primary-200); + border-right-color: rgb(var(--color-primary-200)); } .prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before { @@ -585,7 +585,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(h1):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-900); + color: rgb(var(--color-neutral-900)); font-weight: 800; font-size: 2.25em; margin-top: 0; @@ -599,7 +599,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(h2):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); font-weight: 700; font-size: 1.5em; margin-top: 2em; @@ -613,7 +613,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(h3):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); font-weight: 600; font-size: 1.25em; margin-top: 1.6em; @@ -627,7 +627,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(h4):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); font-weight: 600; margin-top: 1.5em; margin-bottom: 0.5em; @@ -652,7 +652,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(code):not(:where([class~="not-prose"] *)) { - color: var(--color-secondary-700); + color: rgb(var(--color-secondary-700)); font-weight: 600; font-size: 0.875em; } @@ -666,12 +666,12 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(a code):not(:where([class~="not-prose"] *)) { - color: var(--color-secondary-700); + color: rgb(var(--color-secondary-700)); } .prose :where(pre):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-700); - background-color: var(--color-neutral-50); + color: rgb(var(--color-neutral-700)); + background-color: rgb(var(--color-neutral-50)); overflow-x: auto; font-weight: 400; font-size: 0.875em; @@ -691,7 +691,7 @@ Ensure the default browser behavior of the `hidden` attribute. border-radius: 0; padding: 0; font-weight: inherit; - color: var(--color-neutral-700); + color: rgb(var(--color-neutral-700)); font-size: inherit; font-family: inherit; line-height: inherit; @@ -721,7 +721,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(thead th):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); font-weight: 600; vertical-align: bottom; padding-right: 0.5714286em; @@ -731,7 +731,7 @@ Ensure the default browser behavior of the `hidden` attribute. .prose :where(tbody tr):not(:where([class~="not-prose"] *)) { border-bottom-width: 1px; - border-bottom-color: var(--color-neutral-300); + border-bottom-color: rgb(var(--color-neutral-300)); } .prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) { @@ -891,19 +891,19 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(ol > li):not(:where([class~="not-prose"] *))::before { - color: var(--color-neutral-800); + color: rgb(var(--color-neutral-800)); } .prose :where(ul > li):not(:where([class~="not-prose"] *))::before { - background-color: var(--color-neutral-500); + background-color: rgb(var(--color-neutral-500)); } .prose :where(thead tr):not(:where([class~="not-prose"] *)) { - border-bottom-color: var(--color-neutral-500); + border-bottom-color: rgb(var(--color-neutral-500)); } .prose :where(kbd):not(:where([class~="not-prose"] *)) { - background-color: var(--color-neutral-200); + background-color: rgb(var(--color-neutral-200)); padding: 0.1rem 0.4rem; border-radius: 0.25rem; font-size: 0.9rem; @@ -911,7 +911,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .prose :where(mark):not(:where([class~="not-prose"] *)) { - background-color: var(--color-secondary-200); + background-color: rgb(var(--color-secondary-200)); padding: 0.1rem 0.2rem; border-radius: 0.12rem; } @@ -931,6 +931,12 @@ body a, body button { width: 1em; } +/* Search */ + +#search-query::-webkit-search-cancel-button, #search-query::-webkit-search-decoration, #search-query::-webkit-search-results-button, #search-query::-webkit-search-results-decoration { + display: none; +} + /* Heading anchors */ .prose .heading-anchor { @@ -945,7 +951,8 @@ body a, body button { .prose .heading-anchor:hover { background-color: transparent !important; - color: var(--color-primary-500) !important; + --tw-text-opacity: 1 !important; + color: rgba(var(--color-primary-500), var(--tw-text-opacity)) !important; -webkit-text-decoration-line: underline !important; text-decoration-line: underline !important; } @@ -959,16 +966,18 @@ body a, body button { .article-pagination a:hover .article-pagination-title { -webkit-text-decoration-line: underline; text-decoration-line: underline; - -webkit-text-decoration-color: var(--color-primary-500); - text-decoration-color: var(--color-primary-500); + -webkit-text-decoration-color: rgb(var(--color-primary-500)); + text-decoration-color: rgb(var(--color-primary-500)); } .article-pagination a:hover .article-pagination-direction { - color: var(--color-primary-700); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-700), var(--tw-text-opacity)); } .dark .article-pagination a:hover .article-pagination-direction { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* RTL support */ @@ -1004,13 +1013,17 @@ body a, body button { .prose .chroma { border-radius: 0.375rem; - background-color: var(--color-neutral-50); - color: var(--color-neutral-700); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-50), var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-700), var(--tw-text-opacity)); } .dark .prose .chroma { - background-color: var(--color-neutral-700); - color: var(--color-neutral-200); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-200), var(--tw-text-opacity)); } /* Other */ @@ -1054,13 +1067,15 @@ body a, body button { margin-right: -1rem; display: block; width: auto; - background-color: var(--color-primary-100); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity)); padding-left: 1rem; padding-right: 1rem; } .dark .chroma .hl { - background-color: var(--color-primary-900); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity)); } .chroma .lntd .hl { @@ -1071,11 +1086,13 @@ body a, body button { /* LineNumbersTable */ .chroma .lnt { - color: var(--color-neutral-600); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-600), var(--tw-text-opacity)); } .dark .chroma .lnt { - color: var(--color-neutral-300); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-300), var(--tw-text-opacity)); } .chroma .lnt { @@ -1086,11 +1103,13 @@ body a, body button { /* LineNumbers */ .chroma .ln { - color: var(--color-neutral-600); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-600), var(--tw-text-opacity)); } .dark .chroma .ln { - color: var(--color-neutral-300); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-300), var(--tw-text-opacity)); } .chroma .ln { @@ -1101,214 +1120,256 @@ body a, body button { /* Keyword */ .chroma .k { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .k { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* KeywordConstant */ .chroma .kc { font-weight: 600; - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .kc { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* KeywordDeclaration */ .chroma .kd { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .kd { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* KeywordNamespace */ .chroma .kn { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .kn { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* KeywordPseudo */ .chroma .kp { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .kp { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* KeywordReserved */ .chroma .kr { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .kr { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* KeywordType */ .chroma .kt { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .kt { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* Name */ .chroma .n { - color: var(--color-secondary-900); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-900), var(--tw-text-opacity)); } .dark .chroma .n { - color: var(--color-secondary-200); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-200), var(--tw-text-opacity)); } /* NameAttribute */ .chroma .na { - color: var(--color-secondary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-800), var(--tw-text-opacity)); } .dark .chroma .na { - color: var(--color-secondary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-300), var(--tw-text-opacity)); } /* NameBuiltin */ .chroma .nb { - color: var(--color-secondary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-800), var(--tw-text-opacity)); } .dark .chroma .nb { - color: var(--color-secondary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-300), var(--tw-text-opacity)); } /* NameBuiltinPseudo */ .chroma .bp { - color: var(--color-secondary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-800), var(--tw-text-opacity)); } .dark .chroma .bp { - color: var(--color-secondary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-300), var(--tw-text-opacity)); } /* NameClass */ .chroma .nc { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .nc { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* NameConstant */ .chroma .no { font-weight: 600; - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .no { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* NameDecorator */ .chroma .nd { - color: var(--color-secondary-900); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-900), var(--tw-text-opacity)); } .dark .chroma .nd { - color: var(--color-secondary-200); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-200), var(--tw-text-opacity)); } /* NameEntity */ .chroma .ni { - color: var(--color-secondary-900); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-900), var(--tw-text-opacity)); } .dark .chroma .ni { - color: var(--color-secondary-200); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-200), var(--tw-text-opacity)); } /* NameException */ .chroma .ne { font-weight: 600; - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .ne { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* NameFunction */ .chroma .nf { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } .dark .chroma .nf { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* NameFunctionMagic */ .chroma .fm { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .fm { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* NameLabel */ .chroma .nl { - color: var(--color-secondary-900); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-900), var(--tw-text-opacity)); } .dark .chroma .nl { - color: var(--color-secondary-200); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-200), var(--tw-text-opacity)); } /* NameNamespace */ .chroma .nn { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .nn { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* NameOther */ .chroma .nx { - color: var(--color-secondary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-800), var(--tw-text-opacity)); } .dark .chroma .nx { - color: var(--color-secondary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-300), var(--tw-text-opacity)); } /* NameProperty */ @@ -1320,312 +1381,373 @@ body a, body button { /* NameTag */ .chroma .nt { - color: var(--color-secondary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-800), var(--tw-text-opacity)); } .dark .chroma .nt { - color: var(--color-secondary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-300), var(--tw-text-opacity)); } /* NameVariable */ .chroma .nv { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .nv { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* NameVariableClass */ .chroma .vc { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .dark .chroma .vc { - color: var(--color-primary-300); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); } /* NameVariableGlobal */ .chroma .vg { font-weight: 600; - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .vg { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* NameVariableInstance */ .chroma .vi { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .vi { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* NameVariableMagic */ .chroma .vm { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .vm { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* Literal */ .chroma .l { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .l { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralDate */ .chroma .ld { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .ld { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralString */ .chroma .s { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .s { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringAffix */ .chroma .sa { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sa { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringBacktick */ .chroma .sb { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sb { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringChar */ .chroma .sc { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sc { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringDelimiter */ .chroma .dl { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .dl { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringDoc */ .chroma .sd { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sd { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringDouble */ .chroma .s2 { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .s2 { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringEscape */ .chroma .se { font-weight: 600; - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .se { - color: var(--color-secondary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-500), var(--tw-text-opacity)); } /* LiteralStringHeredoc */ .chroma .sh { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sh { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringInterpol */ .chroma .si { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .si { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringOther */ .chroma .sx { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sx { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringRegex */ .chroma .sr { font-weight: 600; - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .sr { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringSingle */ .chroma .s1 { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .s1 { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralStringSymbol */ .chroma .ss { font-weight: 600; - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .ss { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* LiteralNumber */ .chroma .m { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .m { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberBin */ .chroma .mb { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .mb { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberFloat */ .chroma .mf { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .mf { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberHex */ .chroma .mh { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .mh { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberInteger */ .chroma .mi { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .mi { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberIntegerLong */ .chroma .il { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .il { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* LiteralNumberOct */ .chroma .mo { - color: var(--color-secondary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-400), var(--tw-text-opacity)); } .dark .chroma .mo { - color: var(--color-secondary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-secondary-600), var(--tw-text-opacity)); } /* Operator */ .chroma .o { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } /* OperatorWord */ .chroma .ow { font-weight: 600; - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } .dark .chroma .ow { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } /* Punctuation */ @@ -1637,11 +1759,13 @@ body a, body button { .chroma .c { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .c { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentHashbang */ @@ -1649,66 +1773,78 @@ body a, body button { .chroma .ch { font-weight: 600; font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .ch { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentMultiline */ .chroma .cm { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .cm { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentSingle */ .chroma .c1 { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .c1 { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentSpecial */ .chroma .cs { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .cs { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentPreproc */ .chroma .cp { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .cp { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* CommentPreprocFile */ .chroma .cpf { font-style: italic; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .chroma .cpf { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } /* Generic */ @@ -1736,37 +1872,44 @@ body a, body button { .chroma .gh { font-weight: 600; - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } /* GenericInserted */ .chroma .gi { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .gi { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* GenericOutput */ .chroma .go { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .go { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* GenericPrompt */ .chroma .gp { - color: var(--color-primary-800); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-800), var(--tw-text-opacity)); } .dark .chroma .gp { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } /* GenericStrong */ @@ -1778,13 +1921,15 @@ body a, body button { /* GenericSubheading */ .chroma .gu { - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } /* GenericTraceback */ .chroma .gt { - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } /* GenericUnderline */ @@ -1799,6 +1944,14 @@ body a, body button { .chroma .w { } +.invisible { + visibility: hidden; +} + +.fixed { + position: fixed; +} + .absolute { position: absolute; } @@ -1807,6 +1960,25 @@ body a, body button { position: relative; } +.inset-0 { + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; +} + +.top-20 { + top: 5rem; +} + +.z-50 { + z-index: 50; +} + +.z-10 { + z-index: 10; +} + .m-auto { margin: auto; } @@ -1830,6 +2002,11 @@ body a, body button { margin-right: 0.25rem; } +.mx-auto { + margin-left: auto; + margin-right: auto; +} + .my-0 { margin-top: 0px; margin-bottom: 0px; @@ -1891,14 +2068,26 @@ body a, body button { margin-bottom: 0.25rem; } -.\!mb-9 { - margin-bottom: 2.25rem !important; -} - .mb-2 { margin-bottom: 0.5rem; } +.-mb-1 { + margin-bottom: -0.25rem; +} + +.ml-2 { + margin-left: 0.5rem; +} + +.mr-2 { + margin-right: 0.5rem; +} + +.\!mb-9 { + margin-bottom: 2.25rem !important; +} + .mt-1 { margin-top: 0.25rem; } @@ -1935,6 +2124,14 @@ body a, body button { height: 6rem; } +.h-8 { + height: 2rem; +} + +.h-12 { + height: 3rem; +} + .h-full { height: 100%; } @@ -1947,6 +2144,10 @@ body a, body button { max-height: 10rem; } +.min-h-0 { + min-height: 0px; +} + .w-36 { width: 9rem; } @@ -1959,10 +2160,22 @@ body a, body button { width: 6rem; } +.w-screen { + width: 100vw; +} + +.w-8 { + width: 2rem; +} + .min-w-\[1\.8rem\] { min-width: 1.8rem; } +.min-w-0 { + min-width: 0px; +} + .min-w-\[2\.4rem\] { min-width: 2.4rem; } @@ -1979,10 +2192,22 @@ body a, body button { max-width: 10rem; } +.max-w-3xl { + max-width: 48rem; +} + .max-w-full { max-width: 100%; } +.flex-none { + flex: none; +} + +.flex-auto { + flex: 1 1 auto; +} + .grow { flex-grow: 1; } @@ -2004,6 +2229,12 @@ body a, body button { list-style-type: none; } +.appearance-none { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + .flex-row { flex-direction: row; } @@ -2036,6 +2267,10 @@ body a, body button { align-self: center; } +.overflow-auto { + overflow: auto; +} + .overflow-hidden { overflow: hidden; } @@ -2078,43 +2313,66 @@ body a, body button { } .border-neutral-400 { - border-color: var(--color-neutral-400); + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-400), var(--tw-border-opacity)); } .border-neutral-300 { - border-color: var(--color-neutral-300); + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-300), var(--tw-border-opacity)); } .border-primary-400 { - border-color: var(--color-primary-400); + --tw-border-opacity: 1; + border-color: rgba(var(--color-primary-400), var(--tw-border-opacity)); } .border-neutral-200 { - border-color: var(--color-neutral-200); + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-200), var(--tw-border-opacity)); } .border-neutral-700 { - border-color: var(--color-neutral-700); + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-700), var(--tw-border-opacity)); } .bg-neutral { - background-color: var(--color-neutral); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral), var(--tw-bg-opacity)); } .bg-primary-200 { - background-color: var(--color-primary-200); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-200), var(--tw-bg-opacity)); +} + +.bg-neutral-500\/50 { + background-color: rgba(var(--color-neutral-500), 0.5); +} + +.bg-transparent { + background-color: transparent; +} + +.bg-neutral-100 { + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-100), var(--tw-bg-opacity)); } .bg-neutral-300 { - background-color: var(--color-neutral-300); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-300), var(--tw-bg-opacity)); } .bg-primary-100 { - background-color: var(--color-primary-100); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity)); } .bg-primary-600 { - background-color: var(--color-primary-600); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-600), var(--tw-bg-opacity)); } .object-scale-down { @@ -2127,6 +2385,10 @@ body a, body button { object-position: left; } +.p-4 { + padding: 1rem; +} + .p-1 { padding: 0.25rem; } @@ -2176,6 +2438,11 @@ body a, body button { padding-bottom: 1.5rem; } +.py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + .px-4 { padding-left: 1rem; padding-right: 1rem; @@ -2186,11 +2453,6 @@ body a, body button { padding-bottom: 0.75rem; } -.py-2 { - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} - .pt-8 { padding-top: 2rem; } @@ -2286,6 +2548,10 @@ body a, body button { text-transform: uppercase; } +.italic { + font-style: italic; +} + .leading-7 { line-height: 1.75rem; } @@ -2299,43 +2565,58 @@ body a, body button { } .text-neutral-400 { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } .text-neutral-900 { - color: var(--color-neutral-900); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-900), var(--tw-text-opacity)); } .text-primary-600 { - color: var(--color-primary-600); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); } .text-neutral-700 { - color: var(--color-neutral-700); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-700), var(--tw-text-opacity)); } .text-neutral-500 { - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .text-primary-500 { - color: var(--color-primary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-500), var(--tw-text-opacity)); } .text-neutral-800 { - color: var(--color-neutral-800); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-800), var(--tw-text-opacity)); } .text-primary-700 { - color: var(--color-primary-700); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-700), var(--tw-text-opacity)); +} + +.text-neutral-600 { + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-600), var(--tw-text-opacity)); } .text-primary-400 { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } .\!text-neutral { - color: var(--color-neutral) !important; + --tw-text-opacity: 1 !important; + color: rgba(var(--color-neutral), var(--tw-text-opacity)) !important; } .\!no-underline { @@ -2343,44 +2624,75 @@ body a, body button { text-decoration-line: none !important; } +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.backdrop-blur-sm { + --tw-backdrop-blur: blur(4px); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + .first\:mt-8:first-child { margin-top: 2rem; } .hover\:border-primary-400:hover { - border-color: var(--color-primary-400); + --tw-border-opacity: 1; + border-color: rgba(var(--color-primary-400), var(--tw-border-opacity)); } .hover\:border-primary-500:hover { - border-color: var(--color-primary-500); + --tw-border-opacity: 1; + border-color: rgba(var(--color-primary-500), var(--tw-border-opacity)); } .hover\:bg-primary-600:hover { - background-color: var(--color-primary-600); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-600), var(--tw-bg-opacity)); +} + +.hover\:bg-primary-100:hover { + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity)); } .hover\:bg-primary-500:hover { - background-color: var(--color-primary-500); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-500), var(--tw-bg-opacity)); } .hover\:\!bg-primary-500:hover { - background-color: var(--color-primary-500) !important; + --tw-bg-opacity: 1 !important; + background-color: rgba(var(--color-primary-500), var(--tw-bg-opacity)) !important; } .hover\:text-primary-700:hover { - color: var(--color-primary-700); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-700), var(--tw-text-opacity)); } .hover\:text-primary-500:hover { - color: var(--color-primary-500); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-500), var(--tw-text-opacity)); } .hover\:text-primary-400:hover { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); +} + +.hover\:text-neutral-600:hover { + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-600), var(--tw-text-opacity)); } .hover\:text-neutral:hover { - color: var(--color-neutral); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral), var(--tw-text-opacity)); } .hover\:underline:hover { @@ -2389,18 +2701,18 @@ body a, body button { } .hover\:decoration-primary-500:hover { - -webkit-text-decoration-color: var(--color-primary-500); - text-decoration-color: var(--color-primary-500); + -webkit-text-decoration-color: rgb(var(--color-primary-500)); + text-decoration-color: rgb(var(--color-primary-500)); } .hover\:decoration-neutral-300:hover { - -webkit-text-decoration-color: var(--color-neutral-300); - text-decoration-color: var(--color-neutral-300); + -webkit-text-decoration-color: rgb(var(--color-neutral-300)); + text-decoration-color: rgb(var(--color-neutral-300)); } .hover\:decoration-primary-400:hover { - -webkit-text-decoration-color: var(--color-primary-400); - text-decoration-color: var(--color-primary-400); + -webkit-text-decoration-color: rgb(var(--color-primary-400)); + text-decoration-color: rgb(var(--color-primary-400)); } .hover\:decoration-2:hover { @@ -2416,6 +2728,23 @@ body a, body button { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.focus\:bg-primary-100:focus { + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity)); +} + +.focus\:outline-dotted:focus { + outline-style: dotted; +} + +.focus\:outline-2:focus { + outline-width: 2px; +} + +.focus\:outline-transparent:focus { + outline-color: transparent; +} + [dir="ltr"] .ltr\:ml-2 { margin-left: 0.5rem; } @@ -2428,6 +2757,10 @@ body a, body button { margin-left: 0.25rem; } +[dir="ltr"] .ltr\:block { + display: block; +} + [dir="ltr"] .ltr\:inline { display: inline; } @@ -2460,6 +2793,10 @@ body a, body button { margin-right: 0.25rem; } +[dir="rtl"] .rtl\:block { + display: block; +} + [dir="rtl"] .rtl\:inline { display: inline; } @@ -2481,98 +2818,98 @@ body a, body button { } .dark .dark\:prose-light { - color: var(--color-neutral-300); + color: rgb(var(--color-neutral-300)); } .dark .dark\:prose-light a { - color: var(--color-primary-400); - -webkit-text-decoration-color: var(--color-neutral-500); - text-decoration-color: var(--color-neutral-500); + color: rgb(var(--color-primary-400)); + -webkit-text-decoration-color: rgb(var(--color-neutral-500)); + text-decoration-color: rgb(var(--color-neutral-500)); } :where(.dark .dark\:prose-light a:hover):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral) !important; + color: rgb(var(--color-neutral)) !important; text-decoration: none !important; } .dark .dark\:prose-light :where(strong):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral); + color: rgb(var(--color-neutral)); } .dark .dark\:prose-light :where(ol > li):not(:where([class~="not-prose"] *))::before { - color: var(--color-neutral-400); + color: rgb(var(--color-neutral-400)); } .dark .dark\:prose-light :where(ul > li):not(:where([class~="not-prose"] *))::before { - background-color: var(--color-neutral-600); + background-color: rgb(var(--color-neutral-600)); } .dark .dark\:prose-light :where(hr):not(:where([class~="not-prose"] *)) { - border-color: var(--color-neutral-500); + border-color: rgb(var(--color-neutral-500)); } .dark .dark\:prose-light :where(blockquote):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-200); - border-left-color: var(--color-primary-900); - border-right-color: var(--color-primary-900); + color: rgb(var(--color-neutral-200)); + border-left-color: rgb(var(--color-primary-900)); + border-right-color: rgb(var(--color-primary-900)); } .dark .dark\:prose-light :where(h1):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral); + color: rgb(var(--color-neutral)); } .dark .dark\:prose-light :where(h2):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-50); + color: rgb(var(--color-neutral-50)); } .dark .dark\:prose-light :where(h3):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-50); + color: rgb(var(--color-neutral-50)); } .dark .dark\:prose-light :where(h4):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-50); + color: rgb(var(--color-neutral-50)); } .dark .dark\:prose-light :where(figure figcaption):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-400); + color: rgb(var(--color-neutral-400)); } .dark .dark\:prose-light :where(code):not(:where([class~="not-prose"] *)) { - color: var(--color-secondary-400); + color: rgb(var(--color-secondary-400)); } .dark .dark\:prose-light :where(a code):not(:where([class~="not-prose"] *)) { - color: var(--color-secondary-400); + color: rgb(var(--color-secondary-400)); } .dark .dark\:prose-light :where(pre):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-200); - background-color: var(--color-neutral-700); + color: rgb(var(--color-neutral-200)); + background-color: rgb(var(--color-neutral-700)); } .dark .dark\:prose-light :where(pre code):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral-200); + color: rgb(var(--color-neutral-200)); } .dark .dark\:prose-light :where(thead th):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral); + color: rgb(var(--color-neutral)); } .dark .dark\:prose-light :where(thead tr):not(:where([class~="not-prose"] *)) { - border-bottom-color: var(--color-neutral-500); + border-bottom-color: rgb(var(--color-neutral-500)); } .dark .dark\:prose-light :where(tbody tr):not(:where([class~="not-prose"] *)) { - border-bottom-color: var(--color-neutral-700); + border-bottom-color: rgb(var(--color-neutral-700)); } .dark .dark\:prose-light :where(kbd):not(:where([class~="not-prose"] *)) { - background-color: var(--color-neutral-700); - color: var(--color-neutral-300); + background-color: rgb(var(--color-neutral-700)); + color: rgb(var(--color-neutral-300)); } .dark .dark\:prose-light :where(mark):not(:where([class~="not-prose"] *)) { - background-color: var(--color-secondary-400); + background-color: rgb(var(--color-secondary-400)); } .dark .dark\:inline { @@ -2584,75 +2921,117 @@ body a, body button { } .dark .dark\:border-neutral-600 { - border-color: var(--color-neutral-600); + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-600), var(--tw-border-opacity)); } .dark .dark\:border-primary-600 { - border-color: var(--color-primary-600); + --tw-border-opacity: 1; + border-color: rgba(var(--color-primary-600), var(--tw-border-opacity)); +} + +.dark .dark\:border-neutral-700 { + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-700), var(--tw-border-opacity)); } .dark .dark\:bg-neutral-800 { - background-color: var(--color-neutral-800); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-800), var(--tw-bg-opacity)); } .dark .dark\:bg-neutral-600 { - background-color: var(--color-neutral-600); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-600), var(--tw-bg-opacity)); } .dark .dark\:bg-primary-400 { - background-color: var(--color-primary-400); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-400), var(--tw-bg-opacity)); +} + +.dark .dark\:bg-neutral-900\/50 { + background-color: rgba(var(--color-neutral-900), 0.5); } .dark .dark\:bg-neutral-700 { - background-color: var(--color-neutral-700); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity)); } .dark .dark\:bg-primary-900 { - background-color: var(--color-primary-900); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity)); } .dark .dark\:bg-primary-800 { - background-color: var(--color-primary-800); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-800), var(--tw-bg-opacity)); } .dark .dark\:text-neutral-500 { - color: var(--color-neutral-500); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-500), var(--tw-text-opacity)); } .dark .dark\:text-neutral { - color: var(--color-neutral); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral), var(--tw-text-opacity)); } .dark .dark\:text-primary-400 { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); } .dark .dark\:text-neutral-300 { - color: var(--color-neutral-300); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-300), var(--tw-text-opacity)); } .dark .dark\:text-neutral-400 { - color: var(--color-neutral-400); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-400), var(--tw-text-opacity)); } .dark .dark\:text-neutral-800 { - color: var(--color-neutral-800); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-800), var(--tw-text-opacity)); +} + +.dark .dark\:hover\:bg-primary-900:hover { + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity)); } .dark .dark\:hover\:bg-primary-400:hover { - background-color: var(--color-primary-400); + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-400), var(--tw-bg-opacity)); } .dark .dark\:hover\:\!bg-primary-700:hover { - background-color: var(--color-primary-700) !important; + --tw-bg-opacity: 1 !important; + background-color: rgba(var(--color-primary-700), var(--tw-bg-opacity)) !important; } .dark .dark\:hover\:text-primary-400:hover { - color: var(--color-primary-400); + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); +} + +.dark .dark\:hover\:text-neutral-300:hover { + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-300), var(--tw-text-opacity)); } .dark .dark\:hover\:text-neutral-800:hover { - color: var(--color-neutral-800); + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-800), var(--tw-text-opacity)); +} + +.dark .dark\:focus\:bg-primary-900:focus { + --tw-bg-opacity: 1; + background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity)); } @media (min-width: 640px) { @@ -2676,6 +3055,10 @@ body a, body button { align-items: center; } + .sm\:p-6 { + padding: 1.5rem; + } + .sm\:px-14 { padding-left: 3.5rem; padding-right: 3.5rem; @@ -2717,6 +3100,10 @@ body a, body button { width: 33.333333%; } + .md\:p-\[10vh\] { + padding: 10vh; + } + .md\:px-24 { padding-left: 6rem; padding-right: 6rem; @@ -2728,6 +3115,10 @@ body a, body button { width: 25%; } + .lg\:p-\[12vh\] { + padding: 12vh; + } + .lg\:px-32 { padding-left: 8rem; padding-right: 8rem; diff --git a/assets/css/main.css b/assets/css/main.css index 0973d119..075e95cd 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -14,6 +14,14 @@ body button { width: 1em; } +/* Search */ +#search-query::-webkit-search-cancel-button, +#search-query::-webkit-search-decoration, +#search-query::-webkit-search-results-button, +#search-query::-webkit-search-results-decoration { + @apply hidden; +} + /* Heading anchors */ .prose .heading-anchor { @apply absolute top-0 no-underline opacity-0; diff --git a/assets/css/schemes/avocado.css b/assets/css/schemes/avocado.css index c41c6699..911e895d 100644 --- a/assets/css/schemes/avocado.css +++ b/assets/css/schemes/avocado.css @@ -1,37 +1,37 @@ /* Avocado scheme */ :root { - --color-neutral: #fff; + --color-neutral: 255, 255, 255; /* Stone */ - --color-neutral-50: #fafaf9; - --color-neutral-100: #f5f5f4; - --color-neutral-200: #e7e5e4; - --color-neutral-300: #d6d3d1; - --color-neutral-400: #a8a29e; - --color-neutral-500: #78716c; - --color-neutral-600: #57534e; - --color-neutral-700: #44403c; - --color-neutral-800: #292524; - --color-neutral-900: #1c1917; + --color-neutral-50: 250, 250, 249; + --color-neutral-100: 245, 245, 244; + --color-neutral-200: 231, 229, 228; + --color-neutral-300: 214, 211, 209; + --color-neutral-400: 168, 162, 158; + --color-neutral-500: 120, 113, 108; + --color-neutral-600: 87, 83, 78; + --color-neutral-700: 68, 64, 60; + --color-neutral-800: 41, 37, 36; + --color-neutral-900: 28, 25, 23; /* Lime */ - --color-primary-50: #f7fee7; - --color-primary-100: #ecfccb; - --color-primary-200: #d9f99d; - --color-primary-300: #bef264; - --color-primary-400: #a3e635; - --color-primary-500: #84cc16; - --color-primary-600: #65a30d; - --color-primary-700: #4d7c0f; - --color-primary-800: #3f6212; - --color-primary-900: #365314; + --color-primary-50: 247, 254, 231; + --color-primary-100: 236, 252, 203; + --color-primary-200: 217, 249, 157; + --color-primary-300: 190, 242, 100; + --color-primary-400: 163, 230, 53; + --color-primary-500: 132, 204, 22; + --color-primary-600: 101, 163, 13; + --color-primary-700: 77, 124, 15; + --color-primary-800: 63, 98, 18; + --color-primary-900: 54, 83, 20; /* Emerald */ - --color-secondary-50: #ecfdf5; - --color-secondary-100: #d1fae5; - --color-secondary-200: #a7f3d0; - --color-secondary-300: #6ee7b7; - --color-secondary-400: #34d399; - --color-secondary-500: #10b981; - --color-secondary-600: #059669; - --color-secondary-700: #047857; - --color-secondary-800: #065f46; - --color-secondary-900: #064e3b; + --color-secondary-50: 236, 253, 245; + --color-secondary-100: 209, 250, 229; + --color-secondary-200: 167, 243, 208; + --color-secondary-300: 110, 231, 183; + --color-secondary-400: 52, 211, 153; + --color-secondary-500: 16, 185, 129; + --color-secondary-600: 5, 150, 105; + --color-secondary-700: 4, 120, 87; + --color-secondary-800: 6, 95, 70; + --color-secondary-900: 6, 78, 59; } diff --git a/assets/css/schemes/congo.css b/assets/css/schemes/congo.css index 3a67ebc3..375ef7b3 100644 --- a/assets/css/schemes/congo.css +++ b/assets/css/schemes/congo.css @@ -1,37 +1,37 @@ /* Congo scheme */ :root { - --color-neutral: #fff; + --color-neutral: 255, 255, 255; /* Gray */ - --color-neutral-50: #fafafa; - --color-neutral-100: #f4f4f5; - --color-neutral-200: #e4e4e7; - --color-neutral-300: #d4d4d8; - --color-neutral-400: #a1a1aa; - --color-neutral-500: #71717a; - --color-neutral-600: #52525b; - --color-neutral-700: #3f3f46; - --color-neutral-800: #27272a; - --color-neutral-900: #18181b; + --color-neutral-50: 250, 250, 250; + --color-neutral-100: 244, 244, 245; + --color-neutral-200: 228, 228, 231; + --color-neutral-300: 212, 212, 216; + --color-neutral-400: 161, 161, 170; + --color-neutral-500: 113, 113, 122; + --color-neutral-600: 82, 82, 91; + --color-neutral-700: 63, 63, 70; + --color-neutral-800: 39, 39, 42; + --color-neutral-900: 24, 24, 27; /* Violet */ - --color-primary-50: #f5f3ff; - --color-primary-100: #ede9fe; - --color-primary-200: #ddd6fe; - --color-primary-300: #c4b5fd; - --color-primary-400: #a78bfa; - --color-primary-500: #8b5cf6; - --color-primary-600: #7c3aed; - --color-primary-700: #6d28d9; - --color-primary-800: #5b21b6; - --color-primary-900: #4c1d95; + --color-primary-50: 245, 243, 255; + --color-primary-100: 237, 233, 254; + --color-primary-200: 221, 214, 254; + --color-primary-300: 196, 181, 253; + --color-primary-400: 167, 139, 250; + --color-primary-500: 139, 92, 246; + --color-primary-600: 124, 58, 237; + --color-primary-700: 109, 40, 217; + --color-primary-800: 91, 33, 182; + --color-primary-900: 76, 29, 149; /* Fuchsia */ - --color-secondary-50: #fdf4ff; - --color-secondary-100: #fae8ff; - --color-secondary-200: #f5d0fe; - --color-secondary-300: #f0abfc; - --color-secondary-400: #e879f9; - --color-secondary-500: #d946ef; - --color-secondary-600: #c026d3; - --color-secondary-700: #a21caf; - --color-secondary-800: #86198f; - --color-secondary-900: #701a75; + --color-secondary-50: 253, 244, 255; + --color-secondary-100: 250, 232, 255; + --color-secondary-200: 245, 208, 254; + --color-secondary-300: 240, 171, 252; + --color-secondary-400: 232, 121, 249; + --color-secondary-500: 217, 70, 239; + --color-secondary-600: 192, 38, 211; + --color-secondary-700: 162, 28, 175; + --color-secondary-800: 134, 25, 143; + --color-secondary-900: 112, 26, 117; } diff --git a/assets/css/schemes/fire.css b/assets/css/schemes/fire.css index 60ae09c2..ed69d5cb 100644 --- a/assets/css/schemes/fire.css +++ b/assets/css/schemes/fire.css @@ -1,37 +1,37 @@ /* Fire scheme */ :root { - --color-neutral: #fff; + --color-neutral: 255, 255, 255; /* Stone */ - --color-neutral-50: #fafaf9; - --color-neutral-100: #f5f5f4; - --color-neutral-200: #e7e5e4; - --color-neutral-300: #d6d3d1; - --color-neutral-400: #a8a29e; - --color-neutral-500: #78716c; - --color-neutral-600: #57534e; - --color-neutral-700: #44403c; - --color-neutral-800: #292524; - --color-neutral-900: #1c1917; + --color-neutral-50: 250, 250, 249; + --color-neutral-100: 245, 245, 244; + --color-neutral-200: 231, 229, 228; + --color-neutral-300: 214, 211, 209; + --color-neutral-400: 168, 162, 158; + --color-neutral-500: 120, 113, 108; + --color-neutral-600: 87, 83, 78; + --color-neutral-700: 68, 64, 60; + --color-neutral-800: 41, 37, 36; + --color-neutral-900: 28, 25, 23; /* Orange */ - --color-primary-50: #fff7ed; - --color-primary-100: #ffedd5; - --color-primary-200: #fed7aa; - --color-primary-300: #fdba74; - --color-primary-400: #fb923c; - --color-primary-500: #f97316; - --color-primary-600: #ea580c; - --color-primary-700: #c2410c; - --color-primary-800: #9a3412; - --color-primary-900: #7c2d12; + --color-primary-50: 255, 247, 237; + --color-primary-100: 255, 237, 213; + --color-primary-200: 254, 215, 170; + --color-primary-300: 253, 186, 116; + --color-primary-400: 251, 146, 60; + --color-primary-500: 249, 115, 22; + --color-primary-600: 234, 88, 12; + --color-primary-700: 194, 65, 12; + --color-primary-800: 154, 52, 18; + --color-primary-900: 124, 45, 18; /* Rose */ - --color-secondary-50: #fff1f2; - --color-secondary-100: #ffe4e6; - --color-secondary-200: #fecdd3; - --color-secondary-300: #fda4af; - --color-secondary-400: #fb7185; - --color-secondary-500: #f43f5e; - --color-secondary-600: #e11d48; - --color-secondary-700: #be123c; - --color-secondary-800: #9f1239; - --color-secondary-900: #881337; + --color-secondary-50: 255, 241, 242; + --color-secondary-100: 255, 228, 230; + --color-secondary-200: 254, 205, 211; + --color-secondary-300: 253, 164, 175; + --color-secondary-400: 251, 113, 133; + --color-secondary-500: 244, 63, 94; + --color-secondary-600: 225, 29, 72; + --color-secondary-700: 190, 18, 60; + --color-secondary-800: 159, 18, 57; + --color-secondary-900: 136, 19, 55; } diff --git a/assets/css/schemes/ocean.css b/assets/css/schemes/ocean.css index 4dd80e1d..cc6d2d6d 100644 --- a/assets/css/schemes/ocean.css +++ b/assets/css/schemes/ocean.css @@ -1,37 +1,37 @@ /* Ocean scheme */ :root { - --color-neutral: #fff; + --color-neutral: 255, 255, 255; /* Gray */ - --color-neutral-50: #f8fafc; - --color-neutral-100: #f1f5f9; - --color-neutral-200: #e2e8f0; - --color-neutral-300: #cbd5e1; - --color-neutral-400: #94a3b8; - --color-neutral-500: #64748b; - --color-neutral-600: #475569; - --color-neutral-700: #334155; - --color-neutral-800: #1e293b; - --color-neutral-900: #0f172a; + --color-neutral-50: 248, 250, 252; + --color-neutral-100: 241, 245, 249; + --color-neutral-200: 226, 232, 240; + --color-neutral-300: 203, 213, 225; + --color-neutral-400: 148, 163, 184; + --color-neutral-500: 100, 116, 139; + --color-neutral-600: 71, 85, 105; + --color-neutral-700: 51, 65, 85; + --color-neutral-800: 30, 41, 59; + --color-neutral-900: 15, 23, 42; /* Blue */ - --color-primary-50: #eff6ff; - --color-primary-100: #dbeafe; - --color-primary-200: #bfdbfe; - --color-primary-300: #93c5fd; - --color-primary-400: #60a5fa; - --color-primary-500: #3b82f6; - --color-primary-600: #2563eb; - --color-primary-700: #1d4ed8; - --color-primary-800: #1e40af; - --color-primary-900: #1e3a8a; + --color-primary-50: 239, 246, 255; + --color-primary-100: 219, 234, 254; + --color-primary-200: 191, 219, 254; + --color-primary-300: 147, 197, 253; + --color-primary-400: 96, 165, 250; + --color-primary-500: 59, 130, 246; + --color-primary-600: 37, 99, 235; + --color-primary-700: 29, 78, 216; + --color-primary-800: 30, 64, 175; + --color-primary-900: 30, 58, 138; /* Cyan */ - --color-secondary-50: #ecfeff; - --color-secondary-100: #cffafe; - --color-secondary-200: #a5f3fc; - --color-secondary-300: #67e8f9; - --color-secondary-400: #22d3ee; - --color-secondary-500: #06b6d4; - --color-secondary-600: #0891b2; - --color-secondary-700: #0e7490; - --color-secondary-800: #155e75; - --color-secondary-900: #164e63; + --color-secondary-50: 236, 254, 255; + --color-secondary-100: 207, 250, 254; + --color-secondary-200: 165, 243, 252; + --color-secondary-300: 103, 232, 249; + --color-secondary-400: 34, 211, 238; + --color-secondary-500: 6, 182, 212; + --color-secondary-600: 8, 145, 178; + --color-secondary-700: 14, 116, 144; + --color-secondary-800: 21, 94, 117; + --color-secondary-900: 22, 78, 99; } diff --git a/assets/css/schemes/slate.css b/assets/css/schemes/slate.css index a89898a2..3422d284 100644 --- a/assets/css/schemes/slate.css +++ b/assets/css/schemes/slate.css @@ -1,37 +1,37 @@ /* Slate scheme */ :root { - --color-neutral: #fff; + --color-neutral: 255, 255, 255; /* Gray */ - --color-neutral-50: #f9fafb; - --color-neutral-100: #f3f4f6; - --color-neutral-200: #e5e7eb; - --color-neutral-300: #d1d5db; - --color-neutral-400: #9ca3af; - --color-neutral-500: #6b7280; - --color-neutral-600: #4b5563; - --color-neutral-700: #374151; - --color-neutral-800: #1f2937; - --color-neutral-900: #111827; + --color-neutral-50: 249, 250, 251; + --color-neutral-100: 243, 244, 246; + --color-neutral-200: 229, 231, 235; + --color-neutral-300: 209, 213, 219; + --color-neutral-400: 156, 163, 175; + --color-neutral-500: 107, 114, 128; + --color-neutral-600: 75, 85, 99; + --color-neutral-700: 55, 65, 81; + --color-neutral-800: 31, 41, 55; + --color-neutral-900: 17, 24, 39; /* Gray */ - --color-primary-50: #f9fafb; - --color-primary-100: #f3f4f6; - --color-primary-200: #e5e7eb; - --color-primary-300: #d1d5db; - --color-primary-400: #9ca3af; - --color-primary-500: #6b7280; - --color-primary-600: #4b5563; - --color-primary-700: #374151; - --color-primary-800: #1f2937; - --color-primary-900: #111827; + --color-primary-50: 249, 250, 251; + --color-primary-100: 243, 244, 246; + --color-primary-200: 229, 231, 235; + --color-primary-300: 209, 213, 219; + --color-primary-400: 156, 163, 175; + --color-primary-500: 107, 114, 128; + --color-primary-600: 75, 85, 99; + --color-primary-700: 55, 65, 81; + --color-primary-800: 31, 41, 55; + --color-primary-900: 17, 24, 39; /* Gray */ - --color-secondary-50: #f9fafb; - --color-secondary-100: #f3f4f6; - --color-secondary-200: #e5e7eb; - --color-secondary-300: #d1d5db; - --color-secondary-400: #9ca3af; - --color-secondary-500: #6b7280; - --color-secondary-600: #4b5563; - --color-secondary-700: #374151; - --color-secondary-800: #1f2937; - --color-secondary-900: #111827; + --color-secondary-50: 249, 250, 251; + --color-secondary-100: 243, 244, 246; + --color-secondary-200: 229, 231, 235; + --color-secondary-300: 209, 213, 219; + --color-secondary-400: 156, 163, 175; + --color-secondary-500: 107, 114, 128; + --color-secondary-600: 75, 85, 99; + --color-secondary-700: 55, 65, 81; + --color-secondary-800: 31, 41, 55; + --color-secondary-900: 17, 24, 39; } diff --git a/assets/icons/search.svg b/assets/icons/search.svg new file mode 100644 index 00000000..f41bbdd4 --- /dev/null +++ b/assets/icons/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/times.svg b/assets/icons/times.svg new file mode 100644 index 00000000..81446224 --- /dev/null +++ b/assets/icons/times.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/js/search.js b/assets/js/search.js new file mode 100644 index 00000000..cbc42bdc --- /dev/null +++ b/assets/js/search.js @@ -0,0 +1,159 @@ +var fuse; +var showButton = document.getElementById("search-button"); +var hideButton = document.getElementById("close-search-button"); +var wrapper = document.getElementById("search-wrapper"); +var modal = document.getElementById("search-modal"); +var input = document.getElementById("search-query"); +var output = document.getElementById("search-results"); +var first = output.firstChild; +var last = output.lastChild; +var searchVisible = false; +var indexed = false; +var hasResults = false; + +// Listen for events +showButton.addEventListener("click", displaySearch); +hideButton.addEventListener("click", hideSearch); +wrapper.addEventListener("click", hideSearch); +modal.addEventListener("click", function (event) { + event.stopPropagation(); + event.stopImmediatePropagation(); + return false; +}); +document.addEventListener("keydown", function (event) { + // Forward slash to open search wrapper + if (event.key == "/") { + if (!searchVisible) { + event.preventDefault(); + displaySearch(); + } + } + + // Esc to close search wrapper + if (event.key == "Escape") { + hideSearch(); + } + + // Down arrow to move down results list + if (event.key == "ArrowDown") { + if (searchVisible && hasResults) { + event.preventDefault(); + if (document.activeElement == input) { + first.focus(); + } else if (document.activeElement == last) { + last.focus(); + } else { + document.activeElement.parentElement.nextSibling.firstElementChild.focus(); + } + } + } + + // Up arrow to move up results list + if (event.key == "ArrowUp") { + if (searchVisible && hasResults) { + event.preventDefault(); + if (document.activeElement == input) { + input.focus(); + } else if (document.activeElement == first) { + input.focus(); + } else { + document.activeElement.parentElement.previousSibling.firstElementChild.focus(); + } + } + } +}); + +// Update search on each keypress +input.onkeyup = function (event) { + executeQuery(this.value); +}; + +function displaySearch() { + if (!indexed) { + buildIndex(); + } + if (!searchVisible) { + document.body.style.overflow = "hidden"; + wrapper.style.visibility = "visible"; + input.focus(); + searchVisible = true; + } +} + +function hideSearch() { + if (searchVisible) { + document.body.style.overflow = "visible"; + wrapper.style.visibility = "hidden"; + document.activeElement.blur(); + searchVisible = false; + } +} + +function fetchJSON(path, callback) { + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState === 4) { + if (httpRequest.status === 200) { + var data = JSON.parse(httpRequest.responseText); + if (callback) callback(data); + } + } + }; + httpRequest.open("GET", path); + httpRequest.send(); +} + +function buildIndex() { + var baseURL = document + .querySelector('script[data-id="fusejs"][data-url]') + .getAttribute("data-url"); + fetchJSON(baseURL + "index.json", function (data) { + var options = { + shouldSort: true, + ignoreLocation: true, + threshold: 0.0, + includeMatches: true, + keys: [ + { name: "title", weight: 0.8 }, + { name: "section", weight: 0.2 }, + { name: "summary", weight: 0.6 }, + { name: "content", weight: 0.4 }, + ], + }; + fuse = new Fuse(data, options); + indexed = true; + }); +} + +function executeQuery(term) { + let results = fuse.search(term); + let resultsHTML = ""; + + if (results.length > 0) { + results.forEach(function (value, key) { + resultsHTML = + resultsHTML + + `