Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
41 changes: 33 additions & 8 deletions assets/_scss/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
border: none; // コアが border を付与してくるので打ち消す
}

.wp-block-navigation__responsive-container{
.wp-block-navigation {
Copy link
Member

@kurudrive kurudrive Dec 7, 2024

Choose a reason for hiding this comment

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

@mtdkei / Cc: @goutetsuguma @sysbird

変更ありがとうございます!
対象セレクタのクラス名を変更する場合、
もともとなぜそのセレクタになっていたのかを慎重に考えてみましょう(・w・b

この場合、"__responsive-container" が対応になってますが...
よくよく考えたらこのCSSは常時表示のメニュー(ハンバーガーメニューに切り替わらないメニュー)でも当てないといけない内容でしたので、それに気づいてなくて __responsive-container をセレクタにしていた僕の認識間違いです。
なので、このクラス名の変更自体は正しいです。ありがとうございます。

ただ、ここを変更するという事は 他に __responsive-container をセレクタにしている箇所がある場合は同じ勘違い・不具合が発生している可能性が考えられます。
となってくると、これは "縦並びの不具合修正" とは別の意図になってきますので、別のプルリクにしました。
#314

実際こういった感じで、テーマのCSSの修正は元の意図がわかりにくかったり、得にこのテーマはフルサイト編集が初期の頃に手探りで作ったものなので、現行の仕様では不要になった指定や、単純な僕の間違いなども含んでいる事もあり、何気に修正が難しいです。

各意図を把握した上でプルリクを分けないと、後から「なんでこれに指定したんだろう」と思った時も追いにくくなるので、注意しましょう。

実際こういう修正作業は難しいというか、「他人が作ったモノの意図なんかわかるかい!」という部分も多分に含んでしまうので、ものすごく触りにくいと思います。
「そんなん作った石川さんじゃないと気づかないじゃん」案件だと僕も思います。

それを踏まえて、他の人が見て意図がわかるようにテーマのCSSでは特にコメントなど工夫したり、プルリクを細かく区切って出した方がいいかもしれません。

無理難題な気は僕もしているのですが、テーマのCSSを変更する時はそのあたりも気にしつつよろしくお願いいたします。
( ̄人 ̄)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

確かにおっしゃる通りです。ありがとうございます。
プルリクとしてこちらに出していいものか迷ってた部分がありましたのでご確認いただけて幸いです。
今後クラス名を変更する場合はこの点を特に気をつけてみてみたりコメントアウトを残します。

&:not(.has-modal-open) {
.wp-block-navigation__submenu-container {
z-index: 99999; // .crolled-header-fixed specified z-index: 9999; so If less than 9999 that submenu loses to the fix header in the edit screen
Expand Down Expand Up @@ -119,14 +119,29 @@
}
}
}

footer .wp-block-navigation .wp-block-navigation__submenu-container {
width: 100%;

.wp-block-navigation-item {

.wp-block-navigation-item a:not(.wp-element-button),
.wp-block-navigation-submenu a:not(.wp-element-button),
.wp-block-navigation-submenu button.wp-block-navigation-item__content,
.wp-block-pages-list__item button.wp-block-navigation-item__content {
padding-top: .25rem;
padding-bottom: .25rem;
}
}
}

/******************************************************
* Navigation Modal Styles
*/
.has-modal-open {
:where(.wp-block-navigation__container, .wp-block-page-list) {
--wp--style--block-gap: 0;

gap: 0;
&,
li,
li .wp-block-navigation-item__content {
Expand Down Expand Up @@ -203,16 +218,21 @@
.wp-block-navigation.is-vertical {
:where(.wp-block-navigation__container, .wp-block-page-list) {
--wp--style--block-gap: 0;
gap: 0;
gap: inherit;
width: 100%;
}

> .wp-block-navigation-item {
width: 100%;
display: block;
box-sizing: border-box;
}

.items-justified-right .wp-block-navigation-item {
text-align: end;
}

.wp-block-navigation-item {
width: initial;
display: block;
box-sizing: border-box;

Expand All @@ -225,19 +245,24 @@
}
}

.wp-block-navigation-item {
position: relative;
}

.wp-block-navigation__submenu-container {
display: block;
height: auto;
width: 100%;
position: relative;
position: absolute;
opacity: 1;
visibility: visible;
background: none;
visibility: hidden;
color: initial;
transition: opacity .1s linear;
}

@media (min-width: 782px) {
.has-child .wp-block-navigation__submenu-container {
left: 0;
}
}
}
}
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ GitHub : https://github.com/vektor-inc/x-t9

== Changelog ==


[ Design Tuning ] Adjustment when using submenus in core block navigation.
[ Bug Fix ] Fixed a bug where the core block navigation's gap was not being applied.

1.27.1
[ Design Bug Fix ] Fixed an issue where constrained blocks were misaligned inside full-width blocks.
[ Design Bug Fix ][ navigation ] Adjusted to override the WordPress core CSS of wp-block-navigation__submenu-container when the .has-vk-color-primary-background-color class is assigned. (for VK pattern library)
Expand Down