Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8eacc80
Update _navigation.scss
mtdkei Mar 11, 2024
5b6bae9
Update _navigation.scss
mtdkei Mar 11, 2024
ab45ab3
Update _navigation.scss
mtdkei Mar 11, 2024
6e591cb
Update _navigation.scss
mtdkei Mar 11, 2024
3b1c977
Update _navigation.scss
mtdkei Mar 11, 2024
e4ec3ec
Update _navigation.scss
mtdkei Mar 11, 2024
3b19116
Update readme.txt
mtdkei Mar 11, 2024
2aa3f82
Update _navigation.scss
mtdkei Mar 11, 2024
3def443
Update _navigation.scss
mtdkei Mar 11, 2024
a062ecf
Merge branch 'master' into fix/core-navigation-submenu-design
kurudrive May 28, 2024
c04b354
Fixed a typo
mtdkei May 29, 2024
59ca82f
Fix SCSS for submenus
mtdkei May 30, 2024
7ddf10e
gapが効かなかったのを修正
goutetsuguma Dec 4, 2024
153ed68
Merge branch 'master' into fix/core-navigation-submenu-design
goutetsuguma Dec 4, 2024
9c0c574
Merge branch 'master' into fix/core-navigation-submenu-design
Dec 6, 2024
d066dce
Fix: footer navigation
Dec 6, 2024
54f754c
delete space
kurudrive Dec 7, 2024
5be2534
Merge branch 'master' into fix/core-navigation-submenu-design
kurudrive Dec 7, 2024
42e5366
Merge branch 'master' into fix/core-navigation-submenu-design
kurudrive Dec 8, 2024
06fd940
Merge branch 'master' into fix/core-navigation-submenu-design
kurudrive Dec 9, 2024
1a2aa2b
Merge branch 'master' into fix/core-navigation-submenu-design
kurudrive Dec 10, 2024
5a0827f
縦ナビゲーション作り直し
kurudrive Dec 10, 2024
6fbe910
Merge branch 'master' into change/navigation-vertical
kurudrive Dec 10, 2024
f4d4a8b
公開画面側の調整まで
kurudrive Dec 11, 2024
4358061
テキストインライン調整
kurudrive Dec 11, 2024
5bc7c6c
change css file name
kurudrive Dec 12, 2024
67afdc6
リファクタリング
kurudrive Dec 12, 2024
aa5d8fc
縦メニューの孫階層用のアイコンの位置を調整
kurudrive Dec 12, 2024
918a46f
コメントの移動のみ
kurudrive Dec 12, 2024
b636965
編集画面調整
kurudrive Dec 12, 2024
79489ee
Merge branch 'master' into change/navigation-vertical-a
kurudrive Dec 12, 2024
4a671b0
縦方向折りたたみなし追加
kurudrive Dec 12, 2024
af2144f
メニュースタイル名調整
kurudrive Dec 13, 2024
73f5afc
ヘッダーのサブナビゲーション調整
kurudrive Dec 13, 2024
ed0b833
ナビゲーション 編集画面での調整など
kurudrive Dec 13, 2024
f4d9be8
縦の常時の調整がまだ
kurudrive Dec 13, 2024
6089f4c
オーバーレイ時の調整
kurudrive Dec 20, 2024
b4bf2e3
update readme
kurudrive Dec 20, 2024
0204b20
vh を svh に変更
kurudrive Dec 24, 2024
868d56d
vh を svh に変更
kurudrive Dec 24, 2024
cc0f7bd
[ ナビゲーション ] 編集画面での不具合修正
kurudrive Dec 24, 2024
62c7c88
横メニューで縦スタイルを指定した時にサブナビゲーションに色がつく不具合を修正修正
kurudrive Dec 25, 2024
588d8da
[ ナビゲーション ] 背景色ありの時にコアのCSSによって下階層の開始位置が下にいったり右にいったりする処理を上書き
kurudrive Dec 25, 2024
a825593
ナビゲーション 文字サイズ調整
kurudrive Dec 25, 2024
20d3b7e
Merge branch 'master' into change/navigation-vertical-a
kurudrive Dec 25, 2024
ba8d26b
update readme
kurudrive Dec 25, 2024
32c271e
update readme
kurudrive Dec 25, 2024
8a78890
update readme
kurudrive Dec 25, 2024
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
178 changes: 87 additions & 91 deletions assets/_scss/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
* Navigation Styles
*/

/*

// HTML hierarchy
.wp-block-navigation {
.wp-block-navigation__responsive-container {
.wp-block-navigation__responsive-close {
.wp-block-navigation__responsive-dialog {
.wp-block-navigation__responsive-container-content {
:where(.wp-block-navigation__container, .wp-block-page-list) {
.wp-block-navigation-item {
.wp-block-navigation-item__content {}
}
}
}
}
}
}
}

Overlay : off ***********************
.wp-block-navigation
& > ul.wp-block-navigation__container

Overlay : mobile ***********************
.wp-block-navigation
& > .wp-block-navigation__responsive-container.has-modal-open
.wp-block-navigation__responsive-container-content
& > .wp-block-navigation__container.is-responsive

Overlay : allways ***********************
.wp-block-navigation
& >.wp-block-navigation__responsive-container.has-modal-open
.wp-block-navigation__responsive-container-content
& > .wp-block-navigation__container.is-responsive
*/


.wp-block-navigation {

// Cope with mobile menu in align right
Expand All @@ -14,10 +51,14 @@
--submenu-icon-size: 12px;
--nav-top-item-padding-horizontal: 0.9em;

:where( .wp-block-navigation-item__content ) {
padding-top: 0.5em;
padding-bottom: 0.5em;
}

:where(.wp-block-navigation__container, .wp-block-page-list) {
&>.wp-block-navigation-item {
&>a {
padding-left: var(--nav-top-item-padding-horizontal);
padding-right: var(--nav-top-item-padding-horizontal);
}
}
Expand All @@ -29,20 +70,15 @@
// Overlay : off( It is now positioned directly below .wp-block-navigation. )
& > :where( .wp-block-navigation__container, .wp-block-page-list) {
&>.wp-block-navigation-item {
display: grid;
// display: grid;
position: relative;
white-space: nowrap;

&>a {
grid-area: 1/-1;
}

*:where(:not(.is-style-nav--text-inline)) &.has-child>a {
// Additional Padding for submenu-icon
padding-right: calc(var(--submenu-icon-size) + var(--nav-top-item-padding-horizontal) + 0.5em);
}

&>.wp-block-navigation__submenu-icon {
&>:where(.wp-block-navigation__submenu-icon) {
grid-area: 1/-1;
justify-self: end;
width: var(--submenu-icon-size);
Expand All @@ -69,43 +105,22 @@
/******************************************************
* Sub Navigation Styles
*/
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
border: none; // コアが border を付与してくるので打ち消す
}

.wp-block-navigation {
&: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
header & {
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
}

.wp-block-navigation-item {
border-bottom: 1px solid var(--wp--preset--color--border-normal-darkbg);
&:hover {
background-color: var(--wp--preset--color--primary-hover);
}

&__content {
font-size: var(--wp--preset--font-size--x-small);
padding: 1em 1.5em;
}
}

&.has-vk-color-primary-background-color{ // Adjusted to override WordPress core CSS. (for VK Pattern Library)
background-color: var(--wp--preset--color--primary);
}


}
.wp-block-navigation__submenu-container{
&:where(:not(.has-background)) {
.wp-block-navigation-item {
background-color: var(--wp--preset--color--primary);
}
}
&:where(:not(.has-text-color)) {
.wp-block-navigation-item {
color: #fff; // No relation under Bright BG and Dark BG
}
}
&:where(.has-background){
padding:unset; // Cancel the padding added by the WordPress core
}
Expand All @@ -124,13 +139,12 @@
.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 {
width: 100%;
display: block;
box-sizing: border-box;
}

li .wp-block-navigation-item__content {
Expand All @@ -147,9 +161,9 @@
}
}

.wp-block-navigation-item .wp-block-site-logo a {
padding: 1em var(--wp--custom--spacing--menu-indent);
}
// .wp-block-navigation-item .wp-block-site-logo a {
// padding: 1em var(--wp--custom--spacing--menu-indent);
// }

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
.wp-block-navigation-item {
Expand All @@ -176,66 +190,48 @@
}
}
}

// HTML hierarchy
.wp-block-navigation {
.wp-block-navigation__responsive-container {
.wp-block-navigation__responsive-close {
.wp-block-navigation__responsive-dialog {
.wp-block-navigation__responsive-container-content {
:where(.wp-block-navigation__container, .wp-block-page-list) {
.wp-block-navigation-item {
.wp-block-navigation-item__content {}
}
}
}
}
}
}
}
}

/******************************************************
* Vertical Navigation common styles
* Horizontal Navigation common styles
*/
.wp-block-navigation.is-vertical {
:where(.wp-block-navigation__container, .wp-block-page-list) {
--wp--style--block-gap: 0;
gap: 0;
width: 100%;
.wp-block-navigation:where(:not(.is-vertical)) {
Copy link
Contributor

@goutetsuguma goutetsuguma Dec 25, 2024

Choose a reason for hiding this comment

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

コメント欄のコードをコピペしたナビゲーションでは設定がコピーされるので問題ないのですが、
新規でナビゲーションを設置した時に、方向が「横」のまま、スタイルを「Vertical with HR No Fold」や「Vertical with HR」にすると、下階層がキーカラーになります。方向を「縦」にすれば良い話なのですが、スタイルを選択した時にすでにナビが縦並びになるため、ユーザーは気付きにくいかもしれないと思いましたので、以下のスタイルも:not()指定に入れてしまうのはどうでしょうか。

is-style-nav--vertical-with-hr-and-no-foldis-style-nav--vertical-with-hr

変なことを言っていたらすみません!

Copy link
Member Author

Choose a reason for hiding this comment

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

@goutetsuguma ありがとうございます。修正しました!

Copy link
Contributor

@goutetsuguma goutetsuguma Dec 25, 2024

Choose a reason for hiding this comment

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

下階層に色がつかないことを確認しました!ありがとうございました!

.wp-block-navigation-item__content {
padding-left: var(--nav-top-item-padding-horizontal);
}

.items-justified-right .wp-block-navigation-item {
text-align: end;
&:not(.has-background) .wp-block-navigation__submenu-container,
.wp-block-navigation__submenu-container{
border: none; // コアが border を付与してくるので打ち消す
}

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

.items-justified-right & {
text-align: end;
.wp-block-navigation__submenu-container{
&.has-vk-color-primary-background-color{ // Adjusted to override WordPress core CSS. (for VK Pattern Library)
background-color: var(--wp--preset--color--primary);
}

a {
padding: 0;
&:where(:not(.has-background)) {
.wp-block-navigation-item {
background-color: var(--wp--preset--color--primary);
}
}
}

.wp-block-navigation__submenu-container {
display: block;
height: auto;
width: 100%;
position: relative;
opacity: 1;
visibility: visible;
background: none;
}

@media (min-width: 782px) {
.has-child .wp-block-navigation__submenu-container {
left: 0;
.wp-block-navigation-item {
border-bottom: 1px solid var(--wp--preset--color--border-normal-darkbg);
&:hover {
background-color: var(--wp--preset--color--primary-hover);
}
*:where(:not(.is-style-nav--text-inline)) &.has-child>a {
// Additional Padding for submenu-icon
padding-right: calc(var(--submenu-icon-size) + var(--nav-top-item-padding-horizontal) + 0.5em);
}
}
&:where(:not(.has-text-color)) {
.wp-block-navigation-item {
color: #fff; // No relation under Bright BG and Dark BG
}
}
}
}
}
/******************************************************
* Vertical Navigation common styles
*/
:where( .wp-block-navigation.is-vertical ) {
// nothing now
}
Loading