Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By blueswede on
In the Drupal 8 theme guide the definitions of breakpoints is quite good covered - but it seems like its lacking how to use them, or perhaps I'm looking in the wrong place.
I made a THEME.breakpoints.yml
THEME.mobile:
label: mobile
mediaQuery: 'all and (max-width: 489px)'
weight: 3
multipliers:
- 1x
THEME.narrow:
label: narrow
mediaQuery: 'all and (min-width: 490px) and (max-width: 734px)'
weight: 2
multipliers:
- 1x
THEME.medium:
label: medium
mediaQuery: 'all and (min-width: 735px) and (max-width: 979px)'
weight: 1
multipliers:
- 1x
THEME.wide:
label: wide
mediaQuery: 'all and (min-width: 980px)'
weight: 0
multipliers:
- 1x
It results that the toolbar is "normal" only for wide - and turns "mobile" on all other sizes. I guess that "wide" and "mobile" is predefined and my new breakpoints is ignored. For some reason it defaults to "mobile".
My question is - how do I tell the toolbar how to use my new breakpoints?
I have tried to make a THEME.breakpoint_groups.yml file, but that did not help:
group1:
label: Group 1
breakpoints:
- mobile
group2:
label: Group 2
breakpoints:
- wide
- narrow
- medium