Do not allow for duplicated breakpoints in different active themes.

Created on 14 November 2023, 7 months ago

Problem/Motivation

I had a base theme with a "sm" breakpoint and then the child theme with another "sm" breakpoint. In certain circumstances such as with dblog module active the base theme had its BASETHEME.breakpoints.yml processed first getting the group BASETHEME. In this situation, when a responsive image was displayed on the child theme, only the the default image was displayed because the responsive image style was configured to use "CHILDTHEME" as its group.

When the CHILDTHEME get its breakpoints.yml processed first the responsive images work as expected. The base theme is never used to display anything, is just a parent for themes that share stuff.

Steps to reproduce

I think is a race condition but maybe playing with the weights of the themes the base theme can be forced to have its breakpoints to be processed before the child theme.

Create two themes with breakpoints that share a name.
Configure an image style using the breakpoint group from one of the themes.
Display that image style and check if it has all of its sources.

Proposed resolution

I have three possible solutions in mind

  • Breakpoints on child themes override the ones on the parent
  • Namespace breakpoints automatically just like libraries then you have BASETHEME/sm and CHILDTHEME/sm
  • Error on duplicated breakpoints

I'm more inclined to the last options as we shouldn't encourage for theme developer to have breakpoints that have the same name. They should namespace manually such as NAME_OF_THEME.sm.

Remaining tasks

Decide what should be the c

  • orrect behaviour.

    User interface changes

    None

    API changes

    Depends on the decide solution

    Data model changes

    Release notes snippet

    ✨ Feature request
    Status

    Active

    Version

    11.0 πŸ”₯

    Component
    BreakpointΒ  β†’

    Last updated 7 months ago

    Created by

    πŸ‡ͺπŸ‡ΈSpain rodrigoaguilera Barcelona

    Live updates comments and jobs are added and updated live.
    Sign in to follow issues

    Comments & Activities

    Production build 0.69.0 2024