Problem/Motivation
The viewport switcher assumed breakpoint widths were whole numbers in px. Breakpoints in em, like the ones in ui_suite_dsfr_utilities, broke in three ways:
- Every em breakpoint got the generic aspect-ratio icon instead of a device icon.
- Decimal widths like max-width: 35.98em didn't parse, so the breakpoint disappeared.
- Duplicate removal used a 2-unit threshold, which is 32px in em. Separate breakpoints like 36em and 38em merged into one button.
Media queries resolve em and rem against 16px. The switcher now converts em and rem to px at 16px for icons and duplicate removal, and reads widths as floats. Unit tests cover parsing, icons and duplicate removal.
Issue fork display_builder-3622476
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mogtofu33 commented