Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions inc/theme_support.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ function setup_theme() {
add_theme_support( 'automatic-feed-links' );
// Gutenberg用
add_theme_support( 'align-wide' ); // 画像の全幅表示などを可能に
add_theme_support( 'custom-line-height' );
add_theme_support( 'custom-units', 'px', 'rem', 'em', '%', 'vw', 'vh' );
add_theme_support( 'custom-spacing' );
Comment on lines -36 to -38

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

remove_theme_support( 'core-block-patterns' );

// html5サポート
Expand Down
2 changes: 1 addition & 1 deletion src/scss/object/utility/_alignwide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.alignwide {
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変数に置き換えました。

max-width: unset !important; // embedなどのmax100%のものを上書き

// div中の全幅は、内部に収まるように。(ネスト内でも広げたいケースはそれぞれにrevertで0を打ち消す)
Expand Down
22 changes: 6 additions & 16 deletions src/scss/object/utility/_font-size.scss
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@

.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 系クラスは、エディター・フロントエンドともデフォルトで出力されるため削除。

font-size: var(--ark-fz--xs, .75em) !important;

}

.u-fz-s,
.has-small-font-size {
.u-fz-s {
font-size: var(--ark-fz--s, .9em) !important;
}

.u-fz-n,
.has-normal-font-size {
.u-fz-n {
font-size: var(--ark-fz--n, 1rem) !important;
}

.u-fz-m {
font-size: var(--ark-fz--m, 1.1em) !important;
}

.u-fz-l,
.has-large-font-size {
.u-fz-l {
font-size: var(--ark-fz--l, 1.25em) !important;
}

.u-fz-xl,
.has-xlarge-font-size {
.u-fz-xl {
font-size: var(--ark-fz--xl, 1.5em) !important;
}

.u-fz-xxl,
.has-xxlarge-font-size {
.u-fz-xxl {
font-size: var(--ark-fz--xxl, 2em) !important;
}

.has-huge-font-size {
font-size: var(--ark-fz--huge, 2.75em) !important;
}
5 changes: 5 additions & 0 deletions src/scss/post_content/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
.mce-content-body,
.editor-styles-wrapper {

// theme.json を入れた事で消えるpaddingを追加
&.editor-styles-wrapper {
padding: 8px;
}

@import "./post_content";

// エディターではどちらも表示させる(編集できるように)
Expand Down
48 changes: 0 additions & 48 deletions src/scss/post_content/common/utility/_colors.scss

This file was deleted.

40 changes: 40 additions & 0 deletions theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"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.

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

},
"typography": {
"lineHeight": true
},
"spacing": {
"padding": true,
"margin": true,
Comment on lines +13 to +14

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

"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)"
}
]
Comment on lines +15 to +31

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用のバリエーションを作ってもよいかもしれません。

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

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設定が使えるようになる)

}
}