[Bug]: Spacing utility classes not behaving as expected #3444
Labels
Bug
Something isn't working
Community backlog
An issue raised on the community backlog
High priority
Describe the bug
I think I have found a bug with the spacing utility classes in the design system.
Given the following HTML
I would expect that with the above code my h1 would have a bottom margin of 2.5rem, below the medium breakpoint, and a bottom margin of 1 rem above the medium breakpoint.
However, instead I see the following styles in the inspector when viewing the page at a larger breakpoint than 740px:
I did wonder if I should be using one of the combination classes here, and searched the codebase for an example. I found for example the class
ons-u-mt-l@2xs@m
used indesign-system/src/components/footer/_macro.njk
Line 85 in af2ff28
Expected behaviour / outcome
I would expect that with the above code my h1 would have a bottom margin of 2.5rem, below the medium breakpoint, and a bottom margin of 1 rem above the medium breakpoint.
I don't know exactly how this combination class is meant to work, but I expect it to add some margin-top styles, but instead no styles are applied.
List the steps necessary to reproduce the bug
I am seeing this bug when working on the https://github.com/ONSdigital/dis-wagtail repo, by applying the utility classes to any HTML in the codebase. This is using the design-system version 72.1.0. It should be repeatable in any repo using that version of the design system, by applying the relevant utility classes to some markup, and observing the resulting styles.
Additional context
No response
What version of the ONS Design System are you using?
72.1.0
What device(s) are you using?
Desktop
What operating system(s) are you using?
macOS
What browser(s) are you using?
Chrome
The text was updated successfully, but these errors were encountered: