Skip to content

Question about skew(x, y) #13589

Answered by alex-krasikau
Wulgaren asked this question in Help
Apr 26, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hello @Wulgaren!

Tailwind CSS doesn't support translate-z, so implementing it with built-in utilities isn't possible. You have a few options:

  1. Use arbitrary transform syntax and pass the whole declaration like this: class="[transform:skew(50deg,-20deg)_scaleY(0.66667)_translate3d(0,0,1px)]". This is how I would implement it in my app for one or two use cases.

  2. For multiple uses in a component-based framework, you can still use arbitrary syntax and abstract it with a separate component.

<MyTransform className="p-8 bg-red-300">...</MyTransform>
  1. If you're not using frameworks, using a few CSS custom classes is totally fine:
.my-transform {
  transform: skew(50deg, -20deg) scaleY(0.66667) 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Wulgaren
Comment options

@alex-krasikau
Comment options

Answer selected by Wulgaren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants