Skip to content

Add glass (glassmorphic) theme and CSS-only demo toggle#58

Draft
developit wants to merge 8 commits intomainfrom
codex/add-glassmorphic-theme-to-pui
Draft

Add glass (glassmorphic) theme and CSS-only demo toggle#58
developit wants to merge 8 commits intomainfrom
codex/add-glassmorphic-theme-to-pui

Conversation

@developit
Copy link
Copy Markdown
Owner

Motivation

  • Provide a second, glassmorphic theme that is transparency-first with a subtle gradient backdrop while keeping runtime JS to a minimum.
  • Make the theme easy to opt into from the demo with a zero-JS toggle so consumers can adopt the style with only HTML/CSS.

Description

  • Added new theme tokens and variables in src/variables.css including --p-glass-backdrop, --p-theme-bg, and a scoped theme block selectable via :root:has(#pui-theme-glass:checked), [data-theme="glass"], or .glass.
  • Implemented a layered gradient/radial --p-theme-bg and set --p-glass-backdrop: blur(18px) saturate(140%) to drive the glassmorphic look.
  • Applied backdrop-filter support to surface components by updating src/components/card/style.css, src/components/popover/style.css, and src/components/hover-card/style.css to use var(--p-glass-backdrop).
  • Wired a CSS-only toggle in the demo by inserting a hidden checkbox #pui-theme-glass in demo/index.html, adding a label toggle in demo/src/nav.tsx, and styling the toggle and demo background in demo/src/style.css to use --p-theme-bg and the backdrop variable.

Testing

  • Launched the demo dev server with pnpm -C demo exec vite --host 0.0.0.0 --port 4173 and confirmed the server reported ready.
  • Ran an automated Playwright script that opened http://127.0.0.1:4173/, clicked the "Glass" toggle, and produced a screenshot at artifacts/pui-glass-theme.png, which completed successfully.
  • No unit tests were run.

Codex Task

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 3, 2026

Deploy Preview for pui-demo ready!

Name Link
🔨 Latest commit fe0542c
🔍 Latest deploy log https://app.netlify.com/projects/pui-demo/deploys/69817105656b290008cbabf0
😎 Deploy Preview https://deploy-preview-58--pui-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2026

Size Change: +377 B (+3.55%)

Total Size: 11 kB

Filename Size Change
dist/index.css 6.03 kB +377 B (+6.67%) 🔍
ℹ️ View Unchanged
Filename Size
dist/index.js 4.95 kB

compressed-size-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant