https://github.com/pelican-plugins/tailwindcss
Pelican plugin that adds Tailwind CSS support.
https://github.com/pelican-plugins/tailwindcss
css hacktoberfest pelican static-site-generator style tailwindcss
Last synced: about 1 year ago
JSON representation
Pelican plugin that adds Tailwind CSS support.
- Host: GitHub
- URL: https://github.com/pelican-plugins/tailwindcss
- Owner: pelican-plugins
- Created: 2022-03-18T09:45:22.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-24T14:38:29.000Z (over 1 year ago)
- Last Synced: 2025-04-05T19:35:39.404Z (about 1 year ago)
- Topics: css, hacktoberfest, pelican, static-site-generator, style, tailwindcss
- Language: Python
- Homepage: https://pypi.org/project/pelican-tailwindcss/
- Size: 49.8 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Tailwind CSS Plugin for Pelican 🌬
[](https://github.com/pelican-plugins/tailwindcss/actions)
[](https://pypi.org/project/pelican-tailwindcss/)
[](https://pypi.org/project/pelican-tailwindcss/)

This plugin helps you use [Tailwind CSS][] in your Pelican web site.
## Why Use This Plugin?
Because you want use [Tailwind CSS][] in seconds. Not hours.
## Requirements
In order to run this plugin, you need to install Node.JS. (Someday this dependency could be replaced with a Python package.)
## Installation
This plugin can be installed via:
python -m pip install pelican-tailwindcss
As long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `tailwindcss` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.
## Basic Usage
1. Create a `tailwind.config.js` file in your Pelican project root folder containing:
```js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./themes/**/*.html", "./themes/**/*.js"],
theme: {
extend: {},
},
plugins: [],
};
```
The `content` property values are just suggestions. Feel free to modify them according to your needs.
2. Create a `input.css` file in your Pelican project root folder containing:
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
3. Add the build file (`output.css`) in your `base.html`.
```html
```
4. Done! You should be ready to use [Tailwind CSS][] in your website template.
## Advanced Usage
In your settings you can configure the plugin's behavior using the `TAILWIND` setting.
An example of a complete `TAILWIND` setting:
```python
TAILWIND = {
"version": "3.0.0",
"plugins": [
"@tailwindcss/typography",
"@tailwindcss/forms",
"@tailwindcss/line-clamp",
"@tailwindcss/aspect-ratio",
],
}
```
### Tailwind Plugin Installation
As you can see from the example above, it is possible to add the `plugins` property to the configuration.
Just add the name of a Tailwind plugin to the list, and the plugin will be installed.
## Useful Information
### Plugins
Your `tailwind.config.js` file will only be copied when Pelican starts. This means that any changes made after starting Pelican will not be recognized. For example, if you want to install a new plugin for Tailwind, you will have to restart Pelican in order for that plugin to become active.
## Contributing
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].
To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.
[existing issues]: https://github.com/pelican-plugins/tailwindcss/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html
## License
This project is licensed under the AGPL-3.0 license.
[Tailwind CSS]: https://github.com/tailwindlabs/tailwindcss