tw 主题.json
为 Tailwind CSS 创建的插件 转动( t) 自动从 WordPress 主题中拉出颜色和宽度 theme.json 文档,启动时间如下:
// tailwind.config.js
plugins: [
require('@_tw/themejson'),
]
默认情况下 theme.json 文件将从 ./theme/theme.json,相对于当前工作目录。 (默认路径对应 tw.) 您可以通过将新路径作为字符串来覆盖此位置 :
// tailwind.config.js
plugins: [
require('@_tw/themejson')('path/to/theme.json'),
]
您也可以分析 theme.json 在相应的对象中通过 :
// tailwind.config.js
plugins: [
require('@_tw/themejson')(require('path/to/theme.json')),
]
选择使用时可能需要管理缓存 require 分析JSON文件.
启动后, 插件将提取底色调色板( E)settings.color.palette和价值 contentSize 财务报告和审定财务报表 wideSize。 。 。 .
如果您有一个或多个色调板 slug 值与 Tailwind 默认调色板中的弹簧相匹配, 默认调色板中的颜色—— 包括所有阴影—— 将被覆盖 color 从您的值 theme.json 文档.