CSSの登録

よく使うCSSは普通のCSS同様登録できる。

tailwindはその場で書いていけるようにCSSの設定が簡略化されているのが特徴と思うが、やはり毎回書くのはめんどくさい。

resources/css/app.css

@layer components{ }の要素として書いていけばよい。
@applyが必要。

@layer components{
    .btn-blue{
        @apply bg-blue-50 text-stone-600 text-sm font-bold py-2 px-4;
    }
    .btn-blue:hover{
        @apply bg-blue-400 text-white;
    }
  a {
        @apply text-blue-600 underline;
    }
  a:hover{
        @apply text-red-600;
    }
  input {
        @apply border-2 rounded shadow;
    }
}