Skip to content
Snippets Groups Projects

Add styles for block navigation label

Closes #3415067

Merge request reports

Merge train pipeline #118025 passed with warnings

Merge train pipeline passed with warnings for 6ab7ce82

Code Quality is loading
Test summary results are being parsed

Merged by Cristina ChumillasCristina Chumillas Mar 13, 2024 (Mar 13, 2024 9:55am UTC)

Merge details

  • Changes merged into 1.x with 6ab7ce82 (commits were squashed).
  • Did not delete the source branch.
  • Auto-merge enabled

Pipeline #118030 passed with warnings

Pipeline passed with warnings for 6ab7ce82 on 1.x

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 /*
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/3084859
5 * @preserve
6 */
7
8 /**
9 * @file
10 * Navigation block styles.
11 */
12
13 .navigation-block__title {
  • MR updated. Briefly - you were right. But after careful review - i decided to go other way. Here are explanations:

    1. According to rendering system - we are actually rendering block and menu inside of this block (in our case).
    2. We have new hook theme "navigation_block" which is actually repeats core's block hook theme functionality. The label we are trying to achieve - is a block's label.
    3. Same for menu - we have new hook theme registered by name menu_region__content which is based on hook theme menu. If you will check default available props of this hook theme - you will not see title attribute out there https://git.drupalcode.org/project/drupal/-/blob/11.x/core/includes/theme.inc?ref_type=heads#L2061

    What i'm trying to say - is that blocks in drupal has title (and some logic regarding to display this title or not). Menus in drupal doesn't have titles.

    So i would like to stick core's functionality in that case and move block's label on its own layer where it should be. While in menu templates should be no title.

    Menu doesn't have any logic provided for the title - we don't know if title should be visible or not (depending on admin back office checkbox selection). So it just requires even more custom logic if we are gonna keep title in menu layer. But it makes no sense since block's functionality already working clearly.

    So what i did in the my 2nd commit is I have removed toolbar-block__title element from twig, from css, and removed title property for our custom hook theme menu_region__content and removed all the referenced code which injects titles in menu layer.

  • Aubrey Sambor changed this line in version 9 of the diff

    changed this line in version 9 of the diff

  • Please register or sign in to reply
  • added 3 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • reopened

  • m4olivei added 5 commits

    added 5 commits

    Compare with previous version

  • reopened

  • Aubrey Sambor added 8 commits

    added 8 commits

    Compare with previous version

  • Aubrey Sambor added 1 commit

    added 1 commit

    • 0178501c - 3415067: Move title styles to toolbar-block

    Compare with previous version

  • Aubrey Sambor added 1 commit

    added 1 commit

    • cbf5fb58 - 3415067: Move styles around in file

    Compare with previous version

  • reopened

  • Ahsan Nazir added 1 commit

    added 1 commit

    Compare with previous version

  • Ahsan Nazir added 6 commits

    added 6 commits

    • fa90f1e9 - 1 commit from branch project:1.x
    • b1b9c8c3 - Add styles for block navigation label
    • e22ec8dc - Resolving feedbacks
    • f6ae3d11 - 3415067: Move title styles to toolbar-block
    • c59a31f3 - 3415067: Move styles around in file
    • 94db5076 - remove vertical padding.

    Compare with previous version

  • I'm seeing a couple of issues with the code chanages. Visually it's looking good.

  • Ahsan Nazir added 1 commit

    added 1 commit

    Compare with previous version

  • Ivan Berdinsky added 7 commits

    added 7 commits

    • 0b015aad - 1 commit from branch project:1.x
    • 4dc3f041 - Add styles for block navigation label
    • 175f8901 - Resolving feedbacks
    • 361687ff - 3415067: Move title styles to toolbar-block
    • 2ea677c7 - 3415067: Move styles around in file
    • 77d3a08c - remove vertical padding.
    • 2bb4f92f - resolve MR feedback.

    Compare with previous version

  • 77 77 $shortcuts['#items'] = $shortcuts_items;
    78 78 $shortcuts['#theme'] = 'navigation_menu';
    79 79 $shortcuts['#menu_name'] = $this->getPluginId();
    80 $shortcuts['#title'] = $this->configuration['label'];
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Cristina Chumillas started a merge train

    started a merge train

  • Please register or sign in to reply
    Loading