变换
用于通过变换倾斜元素的工具。
Class | Styles |
---|---|
skew-<number> | transform: skewX(<number>deg) skewY(<number>deg); |
-skew-<number> | transform: skewX(-<number>deg) skewY(-<number>deg); |
skew-(<custom-property>) | transform: skewX(var(<custom-property>)) skewY(var(<custom-property>)); |
skew-[<value>] | transform: skewX(<value>) skewY(<value>); |
skew-x-<number> | transform: skewX(<number>deg)); |
-skew-x-<number> | transform: skewX(-<number>deg)); |
skew-x-(<custom-property>) | transform: skewX(var(<custom-property>)); |
skew-x-[<value>] | transform: skewX(<value>)); |
skew-y-<number> | transform: skewY(<number>deg); |
-skew-y-<number> | transform: skewY(-<number>deg); |
skew-y-(<custom-property>) | transform: skewY(var(<custom-property>)); |
skew-y-[<value>] | transform: skewY(<value>); |
使用 skew-<number>
工具,例如 skew-4
和 skew-10
,在两个轴上倾斜元素:
skew-3
skew-6
skew-12
<img class="skew-3 ..." src="/img/mountains.jpg" /><img class="skew-6 ..." src="/img/mountains.jpg" /><img class="skew-12 ..." src="/img/mountains.jpg" />
使用 -skew-<number>
工具,例如 -skew-4
和 -skew-10
,在两个轴上倾斜元素:
-skew-3
-skew-6
-skew-12
<img class="-skew-3 ..." src="/img/mountains.jpg" /><img class="-skew-6 ..." src="/img/mountains.jpg" /><img class="-skew-12 ..." src="/img/mountains.jpg" />
使用 skew-x-<number>
工具,例如 skew-x-4
和 -skew-x-10
,仅在x轴上倾斜元素:
-skew-x-12
skew-x-6
skew-x-12
<img class="-skew-x-12 ..." src="/img/mountains.jpg" /><img class="skew-x-6 ..." src="/img/mountains.jpg" /><img class="skew-x-12 ..." src="/img/mountains.jpg" />
使用 skew-y-<number>
工具,例如 skew-y-4
和 -skew-y-10
,仅在y轴上倾斜元素:
-skew-y-12
skew-y-6
skew-y-12
<img class="-skew-y-12 ..." src="/img/mountains.jpg" /><img class="skew-y-6 ..." src="/img/mountains.jpg" /><img class="skew-y-12 ..." src="/img/mountains.jpg" />
Use the skew-[<value>]
syntax to set the skew based on a completely custom value:
<img class="skew-[3.142rad] ..." src="/img/mountains.jpg" />
For CSS variables, you can also use the skew-(<custom-property>)
syntax:
<img class="skew-(--my-skew) ..." src="/img/mountains.jpg" />
This is just a shorthand for skew-[var(<custom-property>)]
that adds the var()
function for you automatically.
Prefix skewX()
and skewY()
utilities with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<img class="skew-3 md:skew-12 ..." src="/img/mountains.jpg" />
Learn more about using variants in the variants documentation.