【问题标题】:How i can create custom media query in tailwind css?我如何在顺风 css 中创建自定义媒体查询?
【发布时间】:2021-10-24 19:32:15
【问题描述】:

例如,这个媒体查询:

@supports ((-webkit-backdrop-filter: blur(5px)) or (backdrop-filter: blur(5px))) {
    @apply bg-black;
}

需要写成(如@screen):

@support blur5 {
   @apply bg-black;
}

怎么做?

【问题讨论】:

    标签: css tailwind-css


    【解决方案1】:

    将您的类包装在@responsive {} 指令中将生成您使用配置中定义的断点编写的类,例如。默认为 sm、md、lg 和 xl

    @responsive {
      .my-class {}
    }
    

    使用默认断点,它将生成sm:my-classmd:my-class``lg:my-classxl:my-class

    【讨论】:

    • 我为什么需要上课?我需要相当于@screen
    猜你喜欢
    • 2017-03-30
    • 1970-01-01
    • 2019-08-17
    • 2021-03-14
    • 2015-05-06
    • 2015-03-23
    • 2014-09-27
    • 2021-08-21
    • 2015-06-02
    相关资源
    最近更新 更多