內容簡介
透過移除 WordPress 核心區塊的預設樣式,只需要為您在頁面上使用的區塊引用樣式,來增加網站的效能。
您可以選擇在頁面的 head 中加入樣式、footer 中加入樣式、只有當該區塊存在時再行內加樣式,或完全禁用樣式。而且,所有這些都是逐個區塊進行設定!
注意事項:根據您的佈景主題如何覆寫預設樣式,甚至是否進行覆寫,您可能會看到由於 CSS 檔案載入順序或是佈景主題 CSS 規則的特異性不足而導致的問題。
我們建議您嘗試使用區塊選項,找出最符合您使用情境的方法。
外掛標籤
開發者團隊
原文外掛簡介
Increase the performance of your website by removing the default styles for WordPress-Core blocks, and only enqueue styles for the blocks you use on a page.
You can choose to add styles on the head of your pages, on the footer, inline only when the block exists, or even completely disable styles. And all of that, per-block!
IMPORTANT: Depending on how your theme overrides default styles – if it even does, you may see issues due to the loading order of CSS files, or insufficient specificity from the theme’s CSS rules.
We urge you to experiment with the options for blocks and find what suits your use-case better.
