javascript - 添加属性后 Tailwind CSS 无法正确构建
问题描述
我正在尝试使用 Tailwind 构建我的 CSS 文件。我添加了我想要的颜色vlteal
,我希望它显示在我的style.css
. 我已将它添加到 mytailwind.config.js
和 myindex.css
中,我正在构建 Tailwind 输出 , style.css
。
tailwind.config.js
:
module.exports = {
theme: {
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
},
fontFamily: {
display: ['Bahnschrift', 'sans-serif'],
body: ['Barlow', 'sans-serif'],
h1: ['Barlow', 'sans-serif', 'bold-700']
},
borderWidth: {
default: '1px',
'0': '0',
'2': '2px',
'4': '4px',
},
extend: {
colors: {
baseteal: '#9cdbff',
dlteal: '#4796a1',
lteal: '#5EA6B0',
textteal: '#0C3C3F',
ddteal: '#003333',
vlteal: {
DEFAULT: '#18CCCC',
'50': '#D0F9F9',
'100': '#B9F7F7',
'200': '#8CF1F1',
'300': '#5EECEC',
'400': '#30E7E7',
'500': '#18CCCC',
'600': '#139E9E',
'700': '#0D7171',
'800': '#084343',
'900': '#031515'
},
},
}
}
}
我的源 CSS 如下所示:
@tailwind base;
@tailwind components;
@tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@font-face {
font-family: Bahnschrift;
src: url("../fonts/bahnschrift.TTF");
}
@font-face {
font-family: Barlow;
src: url("../fonts/barlow.ttf");
}
.lteal {
color: #5ea6b0;
}
.dlteal {
color:#4796a1;
}
.vlteal {
color: #18CCCC;
}
#fill{
-webkit-text-fill-color: #ffffff;
}
.parallax{
background-image: url("/edupodevhs.github.io/images/LogoMic");
min-height: 500px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin: 0;
}
我的构建命令如下:
npx tailwindcss build css/index.css -o style.css
在添加vlteal
并运行构建命令之前,一切正常。现在,当我尝试加载使用style.css
. 我究竟做错了什么?
解决方案
推荐阅读
- node.js - 当用户输入是节点 postgres 中的模式名称时清理用户输入
- html - 配置清单以抑制 Chrome 扩展中的 Webkit 目录警告?
- c++ - 无法理解在 C++ 中创建类时使用此参数
- loops - While 循环由于寄存器清除而无限运行(x86_64 程序集)
- ubuntu - 在 WSL2 内核关闭时运行脚本?
- reactjs - ReactJS - 尝试在 JSX 中调用函数时出现语法错误
- slack - 通过 Slack 斜杠命令打开网页
- javascript - 使用相对路径时导入不起作用。JavaScript
- laravel - 我正在尝试将我的 laravel 项目移至生产环境,但我无法解决此错误 GuzzleHttp\Exception\ConnectException cURL 错误 7
- python-3.x - 我怎样才能将这些 ndarray 之一重塑为这些形式中的任何一种?如果可能,请提供示例代码