admin管理员组文章数量:1122832
I have the following theme.json
file in a custom classic/hybrid theme:
theme.json file:
"styles": {
"elements": {
"heading": {
"color": {
"text": "#000000"
},
"typography": {
"fontWeight": "700",
"lineHeight": "1.2"
},
"spacing": {
"margin": {
"top": "1rem",
"right": "0",
"bottom": "1rem",
"left": "0"
},
"padding": {
"top": "0",
"right": "0",
"bottom": "0",
"left": "0"
}
}
},
"h1": {
"typography": {
"fontSize": "1.5rem"
}
},
"h2": {
"typography": {
"fontSize": "1.375rem"
}
},
"h3": {
"typography": {
"fontSize": "1.25rem"
}
},
"h4": {
"typography": {
"fontSize": "1.125rem"
}
},
"h5": {
"typography": {
"fontSize": "1.063rem"
}
},
"h6": {
"typography": {
"fontSize": "1rem"
}
}
},
"blocks": {
"core/post-title": {
"typography": {
"fontSize": "1rem"
}
},
}
}
This is the CSS code generated by Gutenberg:
Generated CSS:
.editor-styles-wrapper h2 {
font-size: 1.375rem;
}
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
color: #000000;
font-weight: 700;
line-height: 1.2;
margin-top: 1rem;
margin-right: 0;
margin-bottom: 1rem;
margin-left: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
}
.editor-styles-wrapper :where(.wp-block-post-title) {
font-size: 1rem;
}
As you can see, the generic h1
, h2
, h3
, h4
, h5
and h6
styles take precedence over the specific .wp-block-post-title
block styles. Is this the expected behavior? Can it be switched so that .wp-block-post-title
has a higher priority?
本文标签: cssStyle priority in themejson
版权声明:本文标题:css - Style priority in theme.json 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300034a1930672.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论