Back to Vuetify

Sizing

packages/docs/src/pages/en/styles/sizing.md

4.1.02.7 KB
Original Source

Sizing

Sizing utility classes are used to modify the dimensions of an element.

<PageFeatures />
ClassDescription
h-autoheight: auto
h-screenheight: 100vh
h-0height: 0
h-25height: 25%
h-50height: 50%
h-75height: 75%
h-100height: 100%
fill-heightheight: 100%
height-screenheight: 100dvh
w-autowidth: auto
w-0width: 0
w-33width: 33%
w-25width: 25%
w-50width: 50%
w-66width: 66%
w-75width: 75%
w-100width: 100% { style="max-height: 420px;" fixed-header }
<PromotedEntry />

Usage

The sizing utility classes allow you to quickly style the dimensions of any element. These classes can be used to apply the height and width properties to an element.

Height

Specify the height property of block level elements with a utility class. The following classes are applied using the format .{prefix}-{size} ; where prefix is h and size is the value.

<ExamplesExample file="sizing/height" />

Width

Specify the width property of block level elements with a utility class. The following classes are applied using the format .{prefix}-{size} ; where prefix is w and size is the value.

| Class | Description |

<ExamplesExample file="sizing/width" />

SASS Variables

You can also use the following SASS variables to customize the generated height and width classes:

scss
@use 'vuetify/settings' with (
  $utilities: (
    "fill-height": (
      property: height,
      class: fill,
      values: (
        height: 100%
      )
    ),
    "height": (
      property: height,
      responsive: true,
      class: h,
      values: (
        auto: auto,
        screen: 100vh,
        0: 0,
        25: 25%,
        50: 50%,
        75: 75%,
        100: 100%
      )
    ),
    "height-screen": (
      property: height,
      class: h,
      values: (
        screen: 100dvh
      )
    ),
    "width": (
      property: width,
      responsive: true,
      class: w,
      values: (
        auto: auto,
        0: 0,
        25: 25%,
        33: 33%,
        50: 50%,
        66: 66%,
        75: 75%,
        100: 100%
      )
    )
  )
);

Disable height/width class generation by setting the the fill-height, height, height-screen, and, width variables to false.

scss
@use 'vuetify/settings' with (
  $utilities: (
    "fill-height": false,
    "height": false,
    "height-screen": false,
    "width": false
  )
);