@salla.sa/twilight-tailwind-theme

中文文档
3.0.21发布于 2026/11/02GPL-3.0零依赖

Tailwind theme for twilight (Salla Themes)

原始使用文档
文档目录9 节
  1. Overview
  2. Usage
  3. JIT Enabled
  4. Add a New Component
  5. Publish
  6. Support
  7. Contributing
  8. Credits
  9. License

Logo

Twilight Tailwind-Theme

The Tailwind-Theme Plugin registers the Twilight Web Component styles and injects them using JavaScript instead of CSS. It's a good starting point for Tailwind-based themes.
Explore our blogs »
Report Bug · Request Feature . </Salla Developers> . Official Documentation

Table of Contents
  1. Overview
  2. Usage
  3. Add a New Component
  4. Publish
  5. Support
  6. Contributing
  7. Credits
  8. License

Overview

The Tailwind-Theme Plugin registers the styles needed by the Twilight Web Components and then injects them into the theme stylesheet using JavaScript instead of CSS. It can also be used as a starter theme for any theme based on Tailwind.

Usage

By default, any Tailwind-based theme will look for the tailwind.config.d.ts file at the root of the project to retrieve any pre-settings and customizations. Accordingly, the plugin Tailwind-Theme should be added to the tailwind.config.d.ts file as follows:

plugins: [
  ...
  require('@salla.sa/twilight-tailwind-theme'),
  ....
]

JIT Enabled

Tailwind added a just-in-time compiler, which generates styles as the developer writes the theme rather than generating everything in advance at initial build time. Since JIT mode generates your CSS on-demand by scanning your template files, it’s crucial that the developer configure the content option in the tailwind.config.d.ts file with all of the theme paths, otherwise the CSS classes will be empty.

...
content: [
  // theme views
  "views/**/*.twig",
  // list of classes which required by twilight web components
  "node_modules/@salla.sa/twilight-tailwind-theme/safe-list-css.txt"
],
...

Add a New Component

With Tailwind, developer style elements by applying pre-existing classes directly into the HTML. This is done using utility classes to build custom designs without writing CSS. Based on that, the developer may develop a new component by simple doing the following steps:

  1. Create a new folder with the name of the new compnenet.
  2. Create a utilities.json file with list of new compnenet's classes as json.

Publish

Last, the developer may publish the project using the following command:

npm run publish

(back to top)

Support

The team is always here to help you. Happen to face an issue? Want to report a bug? You can submit one here on Github using the Issue Tracker. If you still have any questions, please contact us via the Telegram Bot or join in the Global Developer Community on Telegram.

(back to top)

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Credits

(back to top)

License

The MIT License (MIT). Please see License File for more information.

(back to top)

版本与发布记录

@salla.sa/twilight-tailwind-theme 共发布 990 个版本,首次发布于 2021/11/18;过去 12 个月发布了 326 个版本。

版本发布日期距今
3.0.21latest2026/11/021 天前
3.0.202026/11/021 天前
3.0.192026/11/021 天前
3.0.182026/11/012 天前
3.0.172026/10/295 天前
3.0.162026/10/285 天前

其他发布通道:beta → 3.0.0-beta.1。

关于 @salla.sa/twilight-tailwind-theme 的常见问题

@salla.sa/twilight-tailwind-theme 是什么?

暮光顺风主题(Salla Themes)

如何安装 @salla.sa/twilight-tailwind-theme?

在项目目录运行 npm install @salla.sa/twilight-tailwind-theme,或使用 pnpm add / yarn add / bun add。

@salla.sa/twilight-tailwind-theme 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/salla.sa__twilight-tailwind-theme 是否存在。

@salla.sa/twilight-tailwind-theme 可以商用吗?

@salla.sa/twilight-tailwind-theme 使用 GPL-3.0 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@salla.sa/twilight-tailwind-theme 还在维护吗?

最新版本 3.0.21 发布于 2026/11/02(1 天前);至今共发布 990 个版本,其中过去 12 个月发布了 326 个;首次发布于 2021/11/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。