diff --git a/docs/assets/images/undraw-content-team.svg b/docs/assets/images/undraw-content-team.svg
index 08bc7482..3ea01ce1 100644
--- a/docs/assets/images/undraw-content-team.svg
+++ b/docs/assets/images/undraw-content-team.svg
@@ -1 +1,80 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/docs/assets/plugins/code-block/code-block.css b/docs/assets/plugins/code-block/code-block.css
index 42e6b56e..66781f77 100644
--- a/docs/assets/plugins/code-block/code-block.css
+++ b/docs/assets/plugins/code-block/code-block.css
@@ -49,7 +49,7 @@
border: solid 1px var(--sl-color-gray-90);
border-bottom: none;
border-radius: 0 !important;
- margin: 0 !important;
+ margin: 0;
display: none;
}
@@ -106,3 +106,42 @@
.code-block--expanded .code-block__toggle svg {
transform: rotate(180deg);
}
+
+/* Dark theme */
+.sl-theme-dark .code-block {
+ background-color: hsl(var(--sl-color-gray-hue), var(--sl-color-gray-saturation), 13%);
+}
+
+.sl-theme-dark .code-block__preview {
+ background-color: var(--sl-color-gray-10);
+ border-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .code-block__source {
+ border-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .code-block__resizer {
+ border-left-color: var(--sl-color-gray-20);
+ background-color: var(--sl-color-gray-10);
+ color: var(--sl-color-gray-60);
+}
+
+.sl-theme-dark .code-block__toggle {
+ background-color: var(--sl-color-gray-10);
+ border-color: var(--sl-color-gray-20);
+ color: var(--sl-color-gray-60);
+}
+
+.sl-theme-dark .code-block__toggle:hover,
+.sl-theme-dark .code-block__toggle:active {
+ background-color: var(--sl-color-gray-10);
+ border-color: var(--sl-color-gray-20);
+ color: var(--sl-color-gray-60);
+}
+
+.sl-theme-dark .code-block__toggle:focus {
+ border-color: var(--sl-color-primary-50);
+ background-color: var(--sl-color-primary-10);
+ color: var(--sl-color-primary-50);
+}
diff --git a/docs/assets/plugins/theme/theme.css b/docs/assets/plugins/theme/theme.css
new file mode 100644
index 00000000..abfc95a9
--- /dev/null
+++ b/docs/assets/plugins/theme/theme.css
@@ -0,0 +1,14 @@
+.theme-toggle {
+ position: fixed;
+ top: .5rem;
+ right: .5rem;
+ z-index: 100;
+}
+
+@media screen and (max-width: 768px) {
+ .theme-toggle {
+ top: .25rem;
+ right: .25rem;
+ transform: scale(.8);
+ }
+}
diff --git a/docs/assets/plugins/theme/theme.js b/docs/assets/plugins/theme/theme.js
new file mode 100644
index 00000000..7e4a3648
--- /dev/null
+++ b/docs/assets/plugins/theme/theme.js
@@ -0,0 +1,41 @@
+(() => {
+ if (!window.$docsify) {
+ throw new Error('Docsify must be loaded before installing this plugin.');
+ }
+
+ window.$docsify.plugins.push((hook, vm) => {
+ hook.mounted(function () {
+ let isDark = localStorage.getItem('theme') === 'sl-theme-dark';
+ const sidebarToggle = document.querySelector('.sidebar-toggle');
+ const noTransitions = Object.assign(document.createElement('style'), {
+ textContent: '* { transition: none !important; }'
+ });
+ const toggle = Object.assign(document.createElement('sl-icon-button'), {
+ name: isDark ? 'sun' : 'moon',
+ label: 'Toggle dark mode'
+ });
+ toggle.classList.add('theme-toggle');
+
+ // Set initial theme
+ if (isDark) {
+ document.body.classList.add('sl-theme-dark');
+ }
+
+ // Toggle theme
+ toggle.addEventListener('click', () => {
+ isDark = !isDark;
+ isDark ? localStorage.setItem('theme', 'sl-theme-dark') : localStorage.removeItem('theme');
+ toggle.name = isDark ? 'sun' : 'moon';
+
+ // Disable transitions as the theme changes
+ document.body.appendChild(noTransitions);
+ requestAnimationFrame(() => {
+ document.body.classList.toggle('sl-theme-dark', isDark);
+ requestAnimationFrame(() => document.body.removeChild(noTransitions));
+ });
+ });
+
+ sidebarToggle.insertAdjacentElement('afterend', toggle);
+ });
+ });
+})();
diff --git a/docs/assets/styles/demos.css b/docs/assets/styles/demos.css
index ac95ce68..559dfa0e 100644
--- a/docs/assets/styles/demos.css
+++ b/docs/assets/styles/demos.css
@@ -37,6 +37,10 @@
width: 100%;
}
+.sl-theme-dark .transition-demo {
+ background: var(--sl-color-gray-20);
+}
+
/* Spacing demo */
.spacing-demo {
width: 100px;
@@ -50,3 +54,7 @@
width: 4rem;
height: 4rem;
}
+
+.sl-theme-dark .elevation-demo {
+ background-color: var(--sl-color-gray-20);
+}
diff --git a/docs/assets/styles/docs-dark.css b/docs/assets/styles/docs-dark.css
new file mode 100644
index 00000000..bab51b61
--- /dev/null
+++ b/docs/assets/styles/docs-dark.css
@@ -0,0 +1,122 @@
+.sl-theme-dark {
+ background: var(--sl-color-gray-10);
+ color: var(--sl-color-gray-80);
+}
+
+/* Sidebar **/
+.sl-theme-dark .sidebar {
+ background: var(--sl-color-gray-10);
+ border-right-color: var(--sl-color-gray-15);
+}
+
+.sl-theme-dark .sidebar li > p {
+ color: var(--sl-color-white);
+ border-bottom-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .sidebar-toggle {
+ background-color: hsla(var(--sl-color-gray-hue), var(--sl-color-gray-saturation), 10%, 0.8);
+}
+
+.sl-theme-dark .docsify-pagination-container {
+ border-top-color: var(--sl-color-gray-20) !important;
+}
+
+/* Search */
+.sl-theme-dark .sidebar .search input[type='search'] {
+ background: var(--sl-input-background-color);
+ border-color: var(--sl-input-border-color);
+ color: var(--sl-input-color);
+}
+
+.sl-theme-dark .sidebar .search input[type='search']:hover {
+ border-color: var(--sl-input-border-color-hover);
+}
+
+.sl-theme-dark .sidebar .search input[type='search']:focus {
+ border-color: var(--sl-input-border-color-focus);
+}
+
+.sl-theme-dark .sidebar .clear-button {
+ color: var(--sl-color-gray-30);
+}
+
+.sl-theme-dark .sidebar .clear-button svg circle {
+ fill: currentColor;
+}
+
+/* Content */
+.sl-theme-dark .component-header {
+ border-bottom-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .anchor span {
+ color: var(--sl-color-white);
+}
+
+.sl-theme-dark .markdown-section h2 {
+ border-bottom-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .markdown-section blockquote {
+ border-left-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .markdown-section kbd {
+ border-color: var(--sl-color-gray-20);
+}
+
+/* Tables */
+.sl-theme-dark .markdown-section tr:nth-child(2n) {
+ background: hsl(var(--sl-color-gray-hue), var(--sl-color-gray-saturation), 13%);
+}
+
+.sl-theme-dark .markdown-section td {
+ border-top-color: var(--sl-color-gray-20);
+ border-bottom-color: var(--sl-color-gray-20);
+}
+
+.sl-theme-dark .markdown-section table .attribute-tooltip {
+ border-bottom-color: var(--sl-color-gray-30);
+}
+
+/* Tips & warnings */
+.sl-theme-dark .markdown-section p.tip,
+.sl-theme-dark .markdown-section p.warn {
+ background-color: hsl(var(--sl-color-gray-hue), var(--sl-color-gray-saturation), 13%)
+}
+
+.sl-theme-dark .markdown-section p.tip code,
+.sl-theme-dark .markdown-section p.warn code {
+ background-color: var(--sl-color-gray-15);
+}
+
+/* Code blocks */
+.sl-theme-dark .markdown-section pre {
+ background-color: hsl(var(--sl-color-gray-hue), var(--sl-color-gray-saturation), 13%);
+}
+
+.sl-theme-dark .markdown-section pre > code {
+ color: var(--sl-color-gray-80);
+}
+
+/* Repo buttons */
+.sl-theme-dark .repo-button {
+ background-color: var(--sl-color-gray-10);
+ border-color: var(--sl-color-gray-25);
+ color: var(--sl-color-gray-80);
+}
+
+.sl-theme-dark .repo-button--github sl-icon {
+ color: var(--sl-color-white);
+}
+
+.sl-theme-dark .repo-button:hover {
+ background-color: var(--sl-color-gray-15);
+ border: solid 1px var(--sl-color-gray-30);
+}
+
+.sl-theme-dark .repo-button:focus {
+ border-color: var(--sl-color-primary-50);
+}
+
diff --git a/docs/assets/styles/docs.css b/docs/assets/styles/docs.css
index b9e93920..8272926b 100644
--- a/docs/assets/styles/docs.css
+++ b/docs/assets/styles/docs.css
@@ -60,7 +60,11 @@ strong {
padding-left: 1rem;
padding-right: 2rem;
margin: 0 1.25rem;
- transition: var(--sl-transition-fast) box-shadow;
+ transition: var(--sl-transition-fast) color, var(--sl-transition-fast) border, var(--sl-transition-fast) box-shadow;
+}
+
+.sidebar .search input[type='search']:hover {
+ border-color: var(--sl-input-border-color-hover);
}
.sidebar .search input[type='search']:focus {
@@ -124,6 +128,15 @@ strong {
padding: .5rem;
}
+.sidebar-toggle:focus {
+ outline: none;
+ box-shadow: var(--sl-focus-ring-box-shadow);
+}
+
+.sidebar-toggle span:last-child {
+ margin-bottom: 0;
+}
+
@media screen and (max-width: 768px) {
body.close .sidebar-toggle {
width: 2rem;
@@ -258,8 +271,8 @@ strong {
margin: 0;
}
-.markdown-section .anchor {
- color: var(--sl-color-primary-50);
+.docsify-pagination-container {
+ border-top-color: var(--sl-color-gray-90) !important;
}
.markdown-section h1,
@@ -332,6 +345,7 @@ strong {
.markdown-section pre > code {
display: block;
background: none;
+ border-radius: 0;
color: var(--sl-color-gray-30);
padding: var(--sl-spacing-medium);
overflow: auto;
@@ -488,6 +502,11 @@ strong {
background-color: var(--sl-color-danger-50);
}
+.markdown-section p.tip code,
+.markdown-section p.warn code {
+ background-color: var(--sl-color-gray-95);
+}
+
/* Component headers */
.component-header {
border-bottom: solid 1px var(--sl-color-gray-90);
diff --git a/docs/components/card.md b/docs/components/card.md
index 97151231..ab9e922e 100644
--- a/docs/components/card.md
+++ b/docs/components/card.md
@@ -28,7 +28,7 @@ Cards can be used to group related subjects in a container.
}
.card-overview small {
- color: var(--sl-color-gray-60);
+ color: var(--sl-color-gray-50);
}
.card-overview [slot="footer"] {
diff --git a/docs/index.html b/docs/index.html
index 62d2f01c..7326c6cf 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -33,8 +33,10 @@
+
+
@@ -93,5 +95,6 @@
+