Skip to content

theme.json 導入テスト#103

Draft
t-hamano wants to merge 8 commits into
masterfrom
try/theme.json
Draft

theme.json 導入テスト#103
t-hamano wants to merge 8 commits into
masterfrom
try/theme.json

Conversation

@t-hamano

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

Copy link
Copy Markdown
Contributor

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

Comment thread inc/theme_support.php
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
Copy Markdown
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 については、デフォルトで全ての単位をサポートしているため、移行せず削除のみ。

position: relative;
left: calc(var(--ark-alignwide_ex_width) * -1);
width: calc(100% + var(--ark-alignwide_ex_width) * 2);
width: var(--wp--style--global--wide-size);

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

Choose a reason for hiding this comment

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

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

Comment thread theme.json
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
Copy Markdown
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 thread theme.json
Comment on lines +13 to +14
"padding": true,
"margin": true,

Copy link
Copy Markdown
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 thread theme.json
Comment on lines +33 to +38
"border": {
"color": true,
"radius": true,
"style": true,
"width": true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

こちらも便利そうなので仮でオプトイン。(グループ、カラムなどでborder設定が使えるようになる)

Comment thread theme.json
"settings": {
"layout": {
"contentSize": "var(--ark-block_width)",
"wideSize": "calc(100% + var(--ark-alignwide_ex_width)*2)"

Copy link
Copy Markdown
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