新しいクラスを作成せずにレイアウトを更新します。Spacingヘルパーは、要素のパディングとマージンを変更する場合に便利です。
プレイグラウンドを使用して、さまざまなヘルパークラスで何ができるかを試してください。それらがどのように機能するかの説明については、以下の動作のしくみセクションを参照してください。
ヘルパークラスは* margin* または padding を 0〜12 の範囲で要素に適用します。各サイズ増分は、一般的なMaterial Design spacingsに合わせて設計されています。これらのクラスは、次の形式 {property}{direction}-{size}
を使用して適用できます。
property は、間隔のタイプを適用します。
m
-margin
を適用します。p
-padding
を適用します。
directionは、プロパティが適用される側を指定します。
t
-margin-top
とpadding-top
の間隔を適用します。b
-margin-bottom
とpadding-bottom
の間隔を適用します。l
-margin-left
とpadding-left
の間隔を適用します。r
-margin-right
とpadding-right
の間隔を適用します。s
-margin-left
/padding-left
(LTR modeの場合) とmargin-right
/padding-right
(RTL modeの場合) の間隔を適用しますe
-margin-right
/padding-right
(LTR modeの場合) とmargin-left
/padding-left
(RTL modeの場合) の間隔を適用しますx
-*-left
と*-right
の両方の間隔を適用します。y
-*-top
と*-bottom
の両方の間隔を適用します。a
- プロパティの間隔をすべての方向に適用します。
size は、プロパティの増分を 4px 間隔で制御します。
1
-margin
またはpadding
を4pxに設定します。2
-margin
またはpadding
を8pxに設定します。3
-margin
またはpadding
を12pxに設定します。4
-margin
またはpadding
を16pxに設定します。5
-margin
またはpadding
を20pxに設定します。6
-margin
またはpadding
を24pxに設定します。7
-margin
またはpadding
を28pxに設定します。8
-margin
またはpadding
を32pxに設定します。9
-margin
またはpadding
を36pxに設定します。10
-margin
またはpadding
を40pxに設定します。11
-margin
またはpadding
を44pxに設定します。12
-margin
またはpadding
を48pxに設定します。n1
- ネガティブmargin
を 4px に設定します。- 'auto' - 間隔を
auto
に設定します。
以下に、簡単な例から複雑な例まで示します。
marginヘルパークラスを使えば、コンテンツを簡単に水平方向にセンタリングすることができます。
マージンは、ネガティブ側にも同様に 1から12 の間隔で適用できます。
Vuetify comes with a 12 point grid system built using Flexbox. Spacing is used to create specific layouts within an application's content. It consists of 5 media breakpoints used to target specific screen sizes or orientations: xs, sm, md, lg and xl. The default resolutions are defined below in the Viewport Breakpoints table and can be modified by customizing the breakpoint service config.
Device | Code | Types | Range |
---|---|---|---|
Extra small | xs | small to large handset | < 600px |
Small | sm | small to medium tablet | 600px > < 960px |
Medium | md | large tablet to laptop | 960px > < 1264px* |
Large | lg | desktop | 1264px* > < 1904px* |
Extra large | xl | 4k and ultra-wides | > 1904px* |
* -16px on Desktop |
The helper classes apply margin or padding at a given breakpoint. These classes can be applied using the following format: {property}{direction}-{breakpoint}-{size}
. This does not apply to xs as it is inferred; e.g. ma-xs-2
equals ma-2
.