Make getCssString work with custom theme
See original GitHub issueIs your feature request related to a problem? Please describe. I am trying to server-side render a custom theme, but it seems like getCssString only renders the default css vars.
Describe the solution you’d like
Stitches could pick up on custom themes created just like it does with calls to the css
function, and render that theme out as well. Then I could just make sure that I attach the correct classname to the body at SSR.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
API - Stitches.dev
A function to create a component including its styles and variants. ... You can use this function if you need to add default...
Read more >How to Create a Custom WordPress Theme - Full Course
Learn how to create a custom WordPress theme. You will learn a process that you can use to convert any HTML/CSS template into...
Read more >Theme tokens not working · Discussion #567 · stitchesjs/stitches
A few things: The config you're passing in is a copy/paste from the docs which isn't really a recommended config. It's more to...
Read more >Using CSS custom properties to apply themes in JavaScript or ...
setProperty('--my-epic-var', someValue);. Let's work through the steps and build up a dynamically loaded theme for ourselves. Building a custom ...
Read more >Theme | Laravue
This project is based on the element-ui default visual style. If you have additional requirements for visual style, you can follow the official...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To get a theme created with
createTheme()
to render intogetCssText
then it needs to be referenced somehow.It works this way to prevent unused CSS from being compiled.
Oh I completely missed your answer @jonathantneal, thanks a ton!
@peduarte I would never have expected this to be the solution to what I see as quite a normal use case, the behavior here doesn’t really seem “intentional” haha. Although my problem specifically is solved, do you think this use case could be better supported, through documentation, and (ideally, I think) a more explicit API?