From 4b184f810246274a6222bb6b1a464c396022ac98 Mon Sep 17 00:00:00 2001 From: amar Date: Fri, 27 Feb 2026 22:48:15 +0530 Subject: [PATCH] Add theme picker to demo page with presets and copy CSS Made-with: Cursor --- .gitignore | 3 + docs/static/demo.css | 88 ++++++++++++++ docs/templates/demo.html | 240 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 330 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1521c8b..89798aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ dist +docs/public +docs/static/oat.min.css +docs/static/oat.min.js diff --git a/docs/static/demo.css b/docs/static/demo.css index 001ba8f..9e8bc33 100644 --- a/docs/static/demo.css +++ b/docs/static/demo.css @@ -37,4 +37,92 @@ body.demo { padding-bottom: 0; } } +} + +.theme-toolbar { + position: sticky; + top: 0; + z-index: 100; + background: var(--background); + border-bottom: 1px solid var(--border); + padding: var(--space-3) var(--space-4); + margin: calc(-1 * var(--space-8)) calc(-1 * var(--container-pad)) var(--space-6); +} + +.theme-toolbar-row { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + gap: var(--space-2); +} + +.theme-toolbar-label { + font-size: var(--text-7); + font-weight: var(--font-semibold); + color: var(--muted-foreground); + margin-right: var(--space-1); +} + +.theme-toolbar input[type="color"] { + width: 28px; + height: 28px; + padding: 0; + border: 2px solid var(--border); + border-radius: var(--radius-full); + cursor: pointer; + background: transparent; + -webkit-appearance: none; + appearance: none; + overflow: hidden; + align-self: center; +} + +.theme-presets-inline, +.theme-presets-dropdown { + display: flex; + align-items: center; +} + +.theme-toolbar input[type="color"]::-webkit-color-swatch-wrapper { + padding: 0; +} + +.theme-toolbar input[type="color"]::-webkit-color-swatch { + border: none; + border-radius: var(--radius-full); +} + +.theme-toolbar input[type="color"]::-moz-color-swatch { + border: none; + border-radius: var(--radius-full); +} + +.theme-preset-btn { + gap: var(--space-1); + font-size: var(--text-8); + opacity: 0.5; + transition: opacity var(--transition-fast); +} + +.theme-preset-btn:hover { + opacity: 0.8; +} + +.theme-preset-btn.active { + opacity: 1; +} + + + +@media (max-width: 600px) { + .theme-presets-inline { + display: none; + } +} + +@media (min-width: 601px) { + .theme-presets-dropdown { + display: none; + } } \ No newline at end of file diff --git a/docs/templates/demo.html b/docs/templates/demo.html index 3041d8a..d54c83f 100644 --- a/docs/templates/demo.html +++ b/docs/templates/demo.html @@ -5,6 +5,55 @@ {% block content %} +
+
+
+ Theme + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + +
+
+

Theme CSS

+

Paste this after oat.min.css in your project.

+
+
+ +
+
+ + +
+
+
+
@@ -601,5 +650,194 @@
Loading placeholder
- + {% endblock %}