Add styles for block navigation label
Closes #3415067
Merge request reports
Activity
- css/components/navigation-block.css 0 → 100644
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 { this code already exist here https://git.drupalcode.org/project/navigation/-/blob/1.x/css/components/toolbar-block.css#L35
MR updated. Briefly - you were right. But after careful review - i decided to go other way. Here are explanations:
- According to rendering system - we are actually rendering block and menu inside of this block (in our case).
- 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. - Same for menu - we have new hook theme registered by name
menu_region__content
which is based on hook thememenu
. If you will check default available props of this hook theme - you will not seetitle
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 removedtitle
property for our custom hook thememenu_region__content
and removed all the referenced code which injects titles in menu layer.changed this line in version 9 of the diff
added 3 commits
-
b4c32a39...7b343750 - 2 commits from branch
project:1.x
- f46c767a - Add styles for block navigation label
-
b4c32a39...7b343750 - 2 commits from branch
added 5 commits
-
2c9af7a0...d51fd354 - 4 commits from branch
project:1.x
- 4ac2d545 - Merge branch '1.x' into 3415067-add-styles-for
-
2c9af7a0...d51fd354 - 4 commits from branch
added 8 commits
-
4ac2d545...bb2afaab - 7 commits from branch
project:1.x
- cf3bdc9a - 3415067: Fix merge conflicts
-
4ac2d545...bb2afaab - 7 commits from branch
- Resolved by Cristina Chumillas
- Resolved by Cristina Chumillas
- Resolved by Cristina Chumillas
- Resolved by Cristina Chumillas
- Resolved by Cristina Chumillas
added 7 commits
Toggle commit list77 77 $shortcuts['#items'] = $shortcuts_items; 78 78 $shortcuts['#theme'] = 'navigation_menu'; 79 79 $shortcuts['#menu_name'] = $this->getPluginId(); 80 $shortcuts['#title'] = $this->configuration['label']; @finnsky This
#title
property is also present inSystemMenuNavigationBlock
class.I wonder if should it be removed from there as well.