使用Tailwind CSS 如何解决Unknown at rule @applyscss(unknownAtRules)警告?

答案来源:https://duncanleung.com/tailwind-css-unknown-at-rule/

问题如下:

@tailwind base;
^^^^^^^^^ 
Unknown at rule @tailwind css(unknownAtRules)

VSCode 解决方案:在工作区设置文件中 settings.json 加载 Tailwind 指令的自定义 CSS 数据集

注意:通常需要重新加载 VS Code 窗口才能识别更改。
// .vscode/settings.json
{
  "css.customData": [".vscode/tailwindcss.json"],
}
// .vscode/tailwindcss.json
{
  "version": 1.1,
  "atDirectives": [
    {
      "name": "@tailwind",
      "description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
      "references": [
        {
          "name": "Tailwind Documentation",
          "url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
        }
      ]
    },
    {
      "name": "@apply",
      "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
      "references": [
        {
          "name": "Tailwind Documentation",
          "url": "https://tailwindcss.com/docs/functions-and-directives#apply"
        }
      ]
    },
    {
      "name": "@responsive",
      "description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n  .alert {\n    background-color: #E53E3E;\n  }\n}\n```\n",
      "references": [
        {
          "name": "Tailwind Documentation",
          "url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
        }
      ]
    },
    {
      "name": "@screen",
      "description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n  /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n  /* ... */\n}\n```\n",
      "references": [
        {
          "name": "Tailwind Documentation",
          "url": "https://tailwindcss.com/docs/functions-and-directives#screen"
        }
      ]
    },
    {
      "name": "@variants",
      "description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n   .btn-brand {\n    background-color: #3182CE;\n  }\n}\n```\n",
      "references": [
        {
          "name": "Tailwind Documentation",
          "url": "https://tailwindcss.com/docs/functions-and-directives#variants"
        }
      ]
    }
  ]
}
  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在Nginx中,可以使用error_page指令来自定义错误页面。通过在主配置文件中添加error_page指令,可以设置不同类型的错误对应的处理方式。例如,可以为每种类型的错误单独设置处理页面,也可以利用在线资源处理指定的错误,还可以更改网站响应的状态码等多种设置。 具体的配置方式如下: 1. 为每种类型的错误设置单独的处理方式: ``` error_page 403 /40x.html; # 处理403错误 error_page 404 /404.jpg; # 处理404错误 ``` 通过以上配置,当发生403错误时,会使用网站根目录下的40x.html文件进行处理;当发生404错误时,会使用网站根目录下的404.jpg图片进行处理。 2. 利用在线资源进行处理错误: ``` error_page 403 http://example.com/forbidden.html; # 处理403错误,跳转到指定URL error_page 500 502 503 504 http://example.com/notfound.html; # 处理一系列指定错误,跳转到指定URL ``` 通过以上配置,在发生指定错误时,会跳转到指定的在线资源进行处理。 3. 隐藏服务器返回的真实状态码信息: ``` error_page 404 =200 /40x.html; ``` 通过以上配置,当发生404错误时,实际的响应状态码会被隐藏,使用自定义的状态码200来响应。 以上是Nginx配置自定义错误页面的几种常用使用方式。通过修改Nginx的主配置文件并重新加载配置,可以使这些配置生效。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [nginx自定义错误页](https://blog.csdn.net/qq_41684621/article/details/109424006)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Nginx——自定义错误页面](https://blog.csdn.net/cold___play/article/details/106697766)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值