Problem/Motivation

These changes are coming from the feedback that we've received from the patch submission that we've made on 9/23/2020.

  1. +++ b/core/themes/olivero/css/components/header.pcss.css
    @@ -0,0 +1,94 @@
    +.header__left {
    

    Maybe there's a better name for this because this is only left when displayed on LTR.

  2. +++ b/core/themes/olivero/css/components/nav-button-wide.pcss.css
    @@ -0,0 +1,104 @@
    +.nav-primary__button {
    
    +++ b/core/themes/olivero/css/components/nav-primary-button.pcss.css
    @@ -0,0 +1,132 @@
    +.primary-nav__button-toggle {
    
    +++ b/core/themes/olivero/css/components/nav-primary.pcss.css
    @@ -0,0 +1,383 @@
    +.primary-nav__menu {
    

    .nav-primary doesn't exist at the moment

  3. +++ b/core/themes/olivero/css/components/nav-secondary.pcss.css
    @@ -0,0 +1,116 @@
    +.secondary-nav__wrapper {
    

    This is not an element of the .secondary-nav because it is not inside it.

Issue fork drupal-3173014

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

proeung created an issue. See original summary.

proeung’s picture

Issue summary: View changes
mherchel’s picture

Title: [Code Review] Address code feedback for the Header .pcss.css partials » Address code feedback for Olivero's header.pcss.css partials
Project: Olivero » Drupal core
Version: 8.x-1.x-dev » 9.1.x-dev
Component: Code » Olivero theme
adamzimmermann’s picture

Assigned: Unassigned » adamzimmermann
adamzimmermann’s picture

Assigned: adamzimmermann » Unassigned
Status: Active » Needs review
FileSize
4.52 KB

I'm not a front-end developer, but I took a swing at this.

1. I changed the class to head__initial.

2. The nav-primary class now exists. I adjusted the JavaScript too.

3. I'm not sure we can do this. The menu template is generic, and any menu block can be placed in the secondary_menu region, so we don't know the machine name of the menu. Happy to be proven wrong though.

4. I'm not seeing secondary-nav__wrapper in any templates. Can we remove these styles or am I missing something?

mherchel’s picture

thanks for the patch!

  1. +++ b/core/themes/olivero/templates/layout/page.html.twig
    @@ -54,8 +54,8 @@
    +          <div class="header__initial">
    

    I think "header__initial" makes sense 👍

  2. +++ b/core/themes/olivero/templates/layout/page.html.twig
    @@ -54,8 +54,8 @@
    +            <button class="nav-primary" aria-controls="site-header__inner" aria-label="Toggle navigation" aria-expanded="false">
    

    "nav-primary" as the button name doesn't seem to make sense to me. IMO we need to be pretty verbose... maybe "wide-nav-expand" or something.

mherchel’s picture

Status: Needs review » Needs work

As far as #3, we can define an explicit template / css class when a type of block is placed in a certain region. We can split that out into another issue though.

#4 You can find secondary-nav__wrapper in https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/themes/olive...

paulocs’s picture

Assigned: Unassigned » paulocs

I'll work on it.

paulocs’s picture

Assigned: paulocs » Unassigned
Status: Needs work » Needs review
FileSize
3.58 KB
4.66 KB

I did the changes suggested in comment #6.

mherchel’s picture

Attaching updated patch with interdiff. Made number of changes including

- moving .secondary-nav__wrapper into .region--secondary-menu . This required some templating changes and also moving the PCSS file into /layout/

- renamed .nav-primary__icon to .wide-nav-expand__icon to keep proper BEM methodology

- renamed nav-button-wide.pcss.css to nav-button-wide.pcss.css

mherchel’s picture

proeung’s picture

+++ b/core/themes/olivero/css/components/navigation/nav-secondary.css
@@ -77,11 +71,11 @@
+        margin-left: 27px

Looks like the build script is not including the closing mark `;` in the compiled version. Can you take a look and see if this is related to the build process.

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Good catch!

I removed node_modules and did a yarn install, and did not see any changes! We should be good!

proeung’s picture

That's odd. I wonder if this is just a way to decreasing the compiled files. Regardless, I don't see anything wrong with this. Marking this as RTBC.

lauriii’s picture

Version: 9.1.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Needs work

Since this patch is changing libraries, we probably cannot backport this to 9.1.x because it would require running updates.

We should add empty post update hook to make sure caches are cleared on the update process.

mherchel’s picture

Status: Needs work » Needs review
FileSize
18.45 KB
522 bytes

empty post update hook is added. Thanks!

proeung’s picture

Status: Needs review » Reviewed & tested by the community

The empty post-update hook function is now included in this patch. Looks good!

lauriii’s picture

Tagging for release manager review because of the changes in libraries and post update hook.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll.

komalk’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
18.6 KB

Re-rolled the patch on 9.2.x.

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Verified patch in #20 is good, and still applies! Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
themes/olivero/css/layout/region-secondary-menu.pcss.css
 30:1  ✖  Unexpected missing end-of-source newline   no-missing-end-of-source-newline

#20 has a coding standards fail. Might as well fix that while waiting for the release manager review.

raman.b’s picture

Status: Needs work » Needs review
FileSize
18.45 KB
1.02 KB

Resolving CS issues

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Changes in #23 look good to me. Thanks!

catch’s picture

If this goes into 9.2.x-only, then I think we can skip the empty post-update, because there is a very high chance of something else having an update that goes into a 9.2.0 deployment.

mherchel’s picture

Status: Reviewed & tested by the community » Needs work

I'm fine with that, and honestly there's no urgent need for 9.1.x.

mherchel’s picture

Status: Needs work » Needs review
FileSize
522 bytes
17.94 KB

Updated patch without the post-update.

proeung’s picture

Patch in #27 applies correctly. We'll need a review from @lauriii to make sure all of his feedback is fully addressed.

proeung’s picture

Status: Needs review » Reviewed & tested by the community

RTBC +1

mherchel’s picture

mherchel’s picture

Status: Reviewed & tested by the community » Needs review
kostyashupenko’s picture

Status: Needs review » Needs work

One little feedback:

--core/themes/olivero/templates/layout/page.html.twig
<button class="wide-nav-expand" aria-controls="site-header__inner" aria-label="Toggle navigation" aria-expanded="false">

aria-label should be translatable

volkswagenchick’s picture

Adding some steps to help a novice contribute successfully:

The flow would be:

morganlyndel’s picture

I am working on this. Thanks!

morganlyndel’s picture

Assigned: Unassigned » morganlyndel
morganlyndel’s picture

Assigned: morganlyndel » Unassigned
Status: Needs work » Needs review
FileSize
17.96 KB

I have just rerolled the patch in comment #30 with the changes in comment #32.

I am new to Drupal Core contribution, and was working with my mentor @volkswagenchick this afternoon to complete this. This is my first core patch and I welcome and feedback!

I would have created an interdiff file but it is a bit outside of my skillset.

I've unassigned myself and changed the status to 'Needs review'.

Thank you!

mherchel’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
827 bytes

Updated interdiff attached.

Thanks for the quick fix. This is looking good to me!

mherchel’s picture

lauriii’s picture

Removing needs release manager review tag based on #25.

  • lauriii committed c117502 on 9.2.x
    Issue #3173014 by mherchel, morganlyndel, paulocs, raman.b,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed c117502 and pushed to 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.