Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Curator: add mobile menu styling #6146

Merged
merged 4 commits into from
Jul 5, 2022
Merged
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
2 changes: 1 addition & 1 deletion curator/parts/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"bottom":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dgap\u002d\u002dvertical)","top":"var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dgap\u002d\u002dvertical)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--gap--vertical);padding-bottom:var(--wp--custom--gap--vertical)"><!-- wp:site-title {"style":{"typography":{"fontSize":"1.375rem"},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}}} /-->

<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"}}}} /--></div>
<!-- wp:navigation {"overlayBackgroundColor":"primary","overlayTextColor":"background","layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"}}}} /--></div>
<!-- /wp:group -->

<!-- wp:separator {"align":"full","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}}} -->
Expand Down
8 changes: 8 additions & 0 deletions curator/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ a:not(
text-underline-offset: 0.25rem;
}

/*
* Needed until https://github.com/WordPress/gutenberg/issues/39142 is fixed.
*/
.wp-block-navigation__responsive-container.is-menu-open ul {
font-size: 2.75rem;
font-weight: 300;
Copy link
Contributor

Choose a reason for hiding this comment

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

The design suggests the items are also vertically centered, but I don't think we should add CSS for that here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah OK.

It would only be one line of CSS, but I know any additional CSS isn't great...

.wp-block-navigation__responsive-container.is-menu-open {
	justify-content: center;
}

This could be an option in GB, and it probably fits into the other conversations around adding styling controls to the mobile navigation (e.g. WordPress/gutenberg#39142).

Copy link
Contributor

Choose a reason for hiding this comment

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

It would only be one line of CSS ...

That would only work for menus that fit completely in the window. Otherwise you can't scroll to get to what's "above" halfway.

There are ways to do it (I think we achieved it with Videomaker eventually) but it's not the simplest of solutions.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would only work for menus that fit completely in the window. Otherwise you can't scroll to get to what's "above" halfway.

Ahh ok, that's not a great solution then!

If it becomes a problem we can add the CSS then, but it sounds like it's best to leave this for now.

}

/*
* Hero post
* The following style are required because variable fontSize doen't work in templates
Expand Down