如何将 use transform css 属性 转换为 tailwind css?

How to convert use transform css property into tailwind css?

我正在尝试将此 class 转换为 css,有些内容可以直接转换。

但是这3个道具我不确定有没有可能tailwind.css?

.toast-top-center {
  position: fixed;
  z-index: 99;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
}

Trying to add with tailwind CSS

.toast-top-center {
  @apply fixed z-40;

  top: 10%; 
  left: 50%;
  transform: translate(-50%, -50%);
}
``

您的 CSS class 与 Tailwind 将是:

.toast-top-center {
  @apply fixed z-99 transform -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/10;
}

要使其正常工作,您要么必须从 Tailwind 切换到 WindiCSS,要么像这样更改您的 tailwind.config.js:

module.exports = {
    theme: {
      inset: {
       // Other fractions if you need them elsewhere
       '1/2': 50%,
       '1/10': '10%',
      },
      zIndex: {
        // Other indexes if you need them elsewhere
        '99': 99
      }
    }
  }