Split from #1734642-152: Move breakpoint module into core since this is not specific to Breakpoint.

The breakpoint module allows themes and other modules to define breakpoints using a yml file called theme_key.yml or module_name.yml and with an easier syntax:

mobile: '(min-width: 0px)'
narrow: 'all and (min-width: 560px) and (max-width:850px)'
wide: 'all and (min-width: 851px)'

The breakpoint module implements the following hooks to import/delete these settings:

  • function breakpoint_enable() {
  • function breakpoint_themes_enabled($theme_list) {
  • function breakpoint_themes_disabled($theme_list) {
  • function breakpoint_modules_enabled($modules) {
  • function breakpoint_modules_uninstalled($modules) {

The reason is that if we don't do this, themes/modules have to follow the naming of the config system to be automatically detected, for the above example this means creating the following files; which isn't really user friendly:

breakpoint.breakpoint.theme.bartik.mobile.yml (and breakpoint.breakpoint.theme.bartik.narrow.yml, breakpoint.breakpoint.theme.bartik.wide.yml) with code like:

id: theme.bartik.mobile
uuid: dff00c01-3399-427e-a400-afd265352888
name: mobile
label: mobile
mediaQuery: '(min-width: 0px)'
source: bartik
sourceType: theme
weight: '0'
  1x: 1x
langcode: und

An also breakpoint.breakpoint_group.theme.bartik.bartik.yml

id: theme.bartik.bartik
uuid: b7d3c3cf-84e6-45d5-b751-8113cb211b37
name: bartik
label: Bartik
  - theme.bartik.mobile
  - theme.bartik.narrow
  - theme.bartik.wide
source: bartik
sourceType: theme
langcode: und

A similar problem exists for image style and probably some other configs.


beejeebus’s picture

Issue tags: -CMI +Configuration system

adding the right configuration system tag so more people see this.

personally, i don't like this proposal.

there be dragons in the filenames for our config files - we overload them with lots of meaning, and that's not really avoidable without some rearchitecture to not force the filename into our public API.

heyrocker’s picture

Status: Active » Closed (won't fix)

I agree with beejeebus. The reasons for naming the files the way they are has been the topic of an extremely large amount of discussion, and there are various places in the code where assumptions are made about it. This may not be the best in the end, but it is what it is.

I don't consider the example usernames user-unfriendly. The repetition of 'breakpoint' is slightly annoying, but in the end does it really matter?

If anything I think that a followup should be made to make breakpoint follow the standard naming convention, because if we don't it will actually be the odd module out that won't match with everyone else.