Skip to content

Expand the Sizing Utility to allow for responsive breakpoints like "w-xl-50" (css, feature, v4) #21943

@matthiku

Description

@matthiku

Currently, the Sizing utility (https://getbootstrap.com/docs/4.1/utilities/sizing/) only allows for the sizing of the height or width of an element without regard to the viewport size.

So for instance the "w-50" class makes a lot of sense on a large device in order to limit the width of, for instance, a help text, but not so much on a small device.

This could be resolved by adding breakpoints to the utility in the same way as it is done for the Spacing utility:

  • w-lg-25 (width: 25% only on large+ devices)
  • w-md-50 (width: 50% only on large+ devices)
  • w-sm-75 (...)
  • w-100 (would be like w-xs-100)

This enhancement would not change existing usage, but would allow more flexibility for various device sizes.

Summary: Add support for the following classes:

w-sm-100, w-sm-75, w-sm-50 and w-sm-25
w-md-100, w-md-75, w-md-50 and w-md-25
w-lg-100, w-lg-75, w-lg-50 and w-lg-25
w-xl-100, w-xl-75, w-xl-50 and w-xl-25
h-sm-100, h-sm-75, h-sm-50 and h-sm-25
h-md-100, h-md-75, h-md-50 and h-md-25
h-lg-100, h-lg-75, h-lg-50 and h-lg-25
h-xl-100, h-xl-75, h-xl-50 and h-xl-25

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions