-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
theme.json 導入テスト #103
base: master
Are you sure you want to change the base?
theme.json 導入テスト #103
Conversation
t-hamano
commented
Jan 8, 2023
add_theme_support( 'custom-line-height' ); | ||
add_theme_support( 'custom-units', 'px', 'rem', 'em', '%', 'vw', 'vh' ); | ||
add_theme_support( 'custom-spacing' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme.jsonへサポート移行。
custom-units
については、デフォルトで全ての単位をサポートしているため、移行せず削除のみ。
width: calc(100% + var(--ark-alignwide_ex_width) * 2); | ||
width: var(--wp--style--global--wide-size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
実質同じ値となりますが、theme.json
の settings.layout.wideSize
の定義から生成されるCSS変数に置き換えました。
.u-fz-xs, | ||
.has-xsmall-font-size { | ||
.u-fz-xs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
フォントサイズの.has-XXX
系クラスは、エディター・フロントエンドともデフォルトで出力されるため削除。
|
||
|
||
/* | ||
テキストカラー | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
カラー系クラスは、エディター・フロントエンドともデフォルトで出力されるためファイル自体を削除。
"spacingSizes": [ | ||
{ | ||
"name": "Small", | ||
"slug": "s", | ||
"size": "var(--ark-mt--s)" | ||
}, | ||
{ | ||
"name": "Normal", | ||
"slug": "normal", | ||
"size": "var(--ark-mt)" | ||
}, | ||
{ | ||
"name": "Normal", | ||
"slug": "h", | ||
"size": "var(--ark-h-mt--h)" | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一旦マージン用CSS変数でバリエーションを定義。
別途spacing用のバリエーションを作ってもよいかもしれません。
"padding": true, | ||
"margin": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding
は、add_theme_support( 'custom-spacing' )
からの移行。
margin
は便利そうなので仮でオプトイン。
"border": { | ||
"color": true, | ||
"radius": true, | ||
"style": true, | ||
"width": true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらも便利そうなので仮でオプトイン。(グループ、カラムなどでborder設定が使えるようになる)
"settings": { | ||
"layout": { | ||
"contentSize": "var(--ark-block_width)", | ||
"wideSize": "calc(100% + var(--ark-alignwide_ex_width)*2)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
幅広の値は、これだとエディター側で上手く動かないため、何らかの調整が必要そう。