-
I’m currently designing a new site using GenerateBlocks and had a few questions related to the Global Style feature.
1. When creating a global style, is there any naming rule…I should follow? For example, should I use dashes (-), double underscores (__), or avoid special characters altogether?
2. Global Style Not Reflecting in Draft Page
I created a card design using the Query Loop block on a draft page. I applied a newly created global style, and it works perfectly in the editor. However, when I preview the page , the style doesn’t appear to be applied … even after clearing the cache.
But, when I copy the same block to the homepage, the global style works correctly. Is this a known issue with draft previews?3. Inline CSS vs External File
Is there a way to output all Global Styles into a separate external CSS file instead of inline <style> tags? From a performance and caching perspective, inline CSS is not good i think…not sure4. I have deleted legacy global style…but still its showing I have 3 glovbal style. but not in the Global Styles (Legacy) page..
-
Alvind
Hi there,
1) There are no strict rules for class naming—you can name your global styles whatever fits your preference or naming convention.
2) Global Styles are saved as a custom post type, so they need to be published in order to be correctly applied and reflected on the frontend preview.
3) By default, Global Style CSS is stored in an external stylesheet. It is only enqueued when a block that uses that global style is present on the page.
4) Regarding this issue—are you still using any of the legacy global styles anywhere on your site?
- You must be logged in to reply to this topic.