Skip to content
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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

theme.json 導入テスト #103

wants to merge 8 commits into from

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Jan 8, 2023

⚠️ このPRは、theme.json導入のためのテストブランチを使用しており、diff確認用のため、マージしないでください。

Comment on lines -36 to -38
add_theme_support( 'custom-line-height' );
add_theme_support( 'custom-units', 'px', 'rem', 'em', '%', 'vw', 'vh' );
add_theme_support( 'custom-spacing' );
Copy link
Contributor Author

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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実質同じ値となりますが、theme.jsonsettings.layout.wideSize の定義から生成されるCSS変数に置き換えました。

.u-fz-xs,
.has-xsmall-font-size {
.u-fz-xs {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

フォントサイズの.has-XXX 系クラスは、エディター・フロントエンドともデフォルトで出力されるため削除。

Comment on lines -1 to -5


/*
テキストカラー
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カラー系クラスは、エディター・フロントエンドともデフォルトで出力されるためファイル自体を削除。

Comment on lines +14 to +30
"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)"
}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一旦マージン用CSS変数でバリエーションを定義。
別途spacing用のバリエーションを作ってもよいかもしれません。

Comment on lines +13 to +14
"padding": true,
"margin": true,
Copy link
Contributor Author

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 は便利そうなので仮でオプトイン。

Comment on lines +33 to +38
"border": {
"color": true,
"radius": true,
"style": true,
"width": true
}
Copy link
Contributor Author

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)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

幅広の値は、これだとエディター側で上手く動かないため、何らかの調整が必要そう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant