Using the Breakpoint module
The Breakpoint module provides a method to create media query breakpoint definitions within Drupal. These can be used by other components, such as the responsive image and toolbar modules, to make Drupal responsive.
Breakpoints are a type of plugin that can be defined in a module's or theme's breakpoints.yml
in its directory. In this recipe, we will define three different breakpoints under a custom group.
Note
Breakpoints are defined solely in YAML
files from installed modules and themes and are not configurable through the user interface.
Getting ready
Ensure that the Breakpoint module is enabled--if you have used the standard Drupal installation, the module is enabled.
This recipe assumes that you have already created a custom module. When you see mymodule
, use the machine name of the module that you created.
How to do it...
- Create
mymodule.breakpoints.yml
in your module's base directory. This file will hold the breakpoint configurations. - Firstly, we will add a standard...