Tailwind 4 custom utilities and component style error - Stack Overflow

@layer components {h1,h2,h3,h4,h5,h5,h6 {@applyfont-medium text-heading text-responsive-sm ;}}@layer

@layer components {
  h1,
  h2,
  h3,
  h4,
  h5,
  h5,
  h6 {
    @apply  font-medium text-heading text-responsive-sm ;
  }


}
@layer utilities{

.text-responsive-sm {
  font-size: 0.75rem; /* text-xs */
}

}

[plugin:@tailwindcss/vite:generate:serve] Cannot apply unknown utility class: text-responsive-sm C:/Users/shahzaib/Downloads/GitHub Huzaifa/claimo/src/app.css

@layer components {
  h1,
  h2,
  h3,
  h4,
  h5,
  h5,
  h6 {
    @apply  font-medium text-heading text-responsive-sm ;
  }


}
@layer utilities{

.text-responsive-sm {
  font-size: 0.75rem; /* text-xs */
}

}

[plugin:@tailwindcss/vite:generate:serve] Cannot apply unknown utility class: text-responsive-sm C:/Users/shahzaib/Downloads/GitHub Huzaifa/claimo/src/app.css

Share Improve this question asked Mar 8 at 18:33 huzaifa sameerhuzaifa sameer 871 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

You'd need to use the @utility directive to register the class with Tailwind so that you can use it in @apply statements:

@utility text-responsive-sm {
  font-size: 0.75rem; /* text-xs */
}

@layer components {
  h1,
  h2,
  h3,
  h4,
  h5,
  h5,
  h6 {
    @apply font-medium text-heading text-responsive-sm ;
  }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744888874a4599283.html

相关推荐

  • Tailwind 4 custom utilities and component style error - Stack Overflow

    @layer components {h1,h2,h3,h4,h5,h5,h6 {@applyfont-medium text-heading text-responsive-sm ;}}@layer

    1天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信