Transforms
Utilities for transforming elements.
Class | Styles |
---|---|
transform-(<custom-property>) | transform: var(<custom-property>); |
transform-[<value>] | transform: <value>; |
transform-none | transform: none; |
transform-gpu | transform: translateZ(0) var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y); |
transform-cpu | transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y); |
If your transition performs better when rendered by the GPU instead of the CPU, you can force hardware acceleration by adding the transform-gpu
utility:
<div class="scale-150 transform-gpu"> <!-- ... --></div>
Use the transform-cpu
utility to force things back to the CPU if you need to undo this conditionally.
Use the transform-none
utility to remove all of the transforms on an element at once:
<div class="skew-y-3 md:transform-none"> <!-- ... --></div>
Use the transform-[<value>]
syntax to set the transform based on a completely custom value:
<div class="transform-[matrix(1,2,3,4,5,6)] ..."> <!-- ... --></div>
For CSS variables, you can also use the transform-(<custom-property>)
syntax:
<div class="transform-(--my-transform) ..."> <!-- ... --></div>
This is just a shorthand for transform-[var(<custom-property>)]
that adds the var()
function for you automatically.
Tailwind CSS 中文网(本网站)的目标是为中文开发者提供准确、及时的 Tailwind CSS 中文文档
Tailwind CSS 中文文档由本网站维护人员共同翻译,采用 MIT 开源协议发布
本网站与 tailwindcss.com 及 Tailwind Labs Inc. 并无从属关系
Tailwind 商标由 Tailwind Labs Inc. 所有
京ICP备15031610号-8