最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to disable the gradient and font size internal CSS added by WordPress when using theme.json

programmeradmin4浏览0评论

While using the recently introduced theme.json file to manage the theme defaults, I have seen something weird. That is even if the customGradient, customFontSize set to false, WordPress is still adding the bunch of styles related the the gradients and font sizes in the internal CSS added by the system.

Here is an example theme.json I am using:

{
    "version": 1,
    "settings": {
        "color": {
            "customGradient": false,
            "link": false,
            "palette": [
                {
                    "name": "Black",
                    "slug": "black",
                    "color": "#000000"
                }
            ]
        },
        "layout": {
            "contentSize": "1296px"
        },
        "spacing": {
            "customMargin": false,
            "customPadding": false,
            "units": [ "px", "em", "rem", "vh", "vw" ]
        },
        "typography": {
            "customFontSize": false,
            "customLineHeight": true,
            "dropCap": false
        }
    }
}

But despite that, when I check the page source I see at the internal CSS added by WordPress has bunch of CSS related to gradients and font sizes. If anyone knows how to disable them, it would be really helpful.

As we are all new to this new theme.json relm, I think helping each other will be the best way to navigate this new world.

P.S.: I've already checked the two URLs about the theme.json documentation, but they didn't help much regarding the queries that I had. These are are links I have already checked:

  • Global Settings & Styles (theme.json)
  • Introducing theme.json in WordPress 5.8

Any help will be really appreciated. Thanks.

发布评论

评论列表(0)

  1. 暂无评论