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

feat: apply theme to preview #200

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Conversation

btea
Copy link
Contributor

@btea btea commented Jan 2, 2024

No description provided.

Copy link

vercel bot commented Jan 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:01am

@yyx990803 yyx990803 merged commit 7ae1061 into vuejs:main Jan 3, 2024
1 check passed
@btea btea deleted the feat/preview-apply-theme branch January 3, 2024 09:00
@pdanpdan
Copy link
Contributor

pdanpdan commented Jan 3, 2024

I think it should also change color - now the playground is black on dark grey by default in dark mode: https://repl-vuejs.vercel.app/

@btea
Copy link
Contributor Author

btea commented Jan 3, 2024

@pdanpdan Do you mean to change the color of h1 tag?

@pdanpdan
Copy link
Contributor

pdanpdan commented Jan 3, 2024

More like define the default color scheme for the playground iframe when dark - now the default expects a like background.

@btea
Copy link
Contributor Author

btea commented Jan 3, 2024

Maybe we can apply the variables here to srcdoc.html.

repl/src/Repl.vue

Lines 136 to 143 in 7ae1061

.dark .vue-repl {
--bg: #1a1a1a;
--bg-soft: #242424;
--border: #383838;
--text-light: #aaa;
--color-branding: #42d392;
--color-branding-dark: #89ddff;
}

@pdanpdan
Copy link
Contributor

pdanpdan commented Jan 3, 2024

AFAIK you cannot style iframe from outside. So themes for light/dark should be defined for the default example.

@btea
Copy link
Contributor Author

btea commented Jan 3, 2024

Yeah, so I mean add the above variables here.

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

@pdanpdan
Copy link
Contributor

pdanpdan commented Jan 3, 2024

I would simply go by defining color: white for html.dark

@btea
Copy link
Contributor Author

btea commented Jan 3, 2024

This is indeed simpler. Are you willing to create a PR to modify it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants