Closed salahtobok closed 7 months ago
Interesting question! With theme.json things are a little more complex than they used to be, because now the CSS styles are generated dynamically from multiple sources: base core styles, theme styles and user configured styles (that can be set in the global styles interface in the site editor).
I guess it would be possible to extend the REST API to create an endpoint for global styles CSS that could then be used in a SPA front end.
If you're happy to use PHP, the wp_get_global_stylesheet
function will output the merged core, theme and user styles in CSS format.
I hope this helps!
Hi guys I'm salahtobok , I'm interested in developing a Blog websites using both using Headless approach which provided by Wordpress ( Rest Api ) & SPA Technologies ( ex : Angular ) ; So my request is the following ; if you can give me an idea to convert theme.json to theme.css, because that is so important for me when I start coding a ( blog post page ) using angular while I can't use theme.json directly to style ( post content component ) which its data was generated by Gutenberg Editor .
Note : in the previous version of Gutenberg Editor I easily was able to to code ( blog post page ) because the styles of Gutenberg Editor style-editor.css was originally generated with ( twentytwentyone theme ), but now with the new feature of theme.json , everything has changed, see the picture below .
Thank you in advance .