Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define TailwindCSS plugins? #29

Open
alexandrehsaad opened this issue Mar 23, 2024 · 2 comments
Open

How to define TailwindCSS plugins? #29

alexandrehsaad opened this issue Mar 23, 2024 · 2 comments

Comments

@alexandrehsaad
Copy link

In my current TailwindCSS project using JS I define plugins in a tailwind.config.js file such as:

plugins: [
    require("@tailwindcss/aspect-ratio"),
    require("@tailwindcss/typography")
]

This file is also where I extended the theme.

With Vapor and SwiftyTailwind, how can I achieve the same thing?

@kicsipixel
Copy link

According to the documentation, it worked for me in the past...
You can create a tailwind.config.js configuration file by running the initialize function on the SwiftyTailwind instance:

try await tailwind.initialize()

@pepicrft
Copy link
Collaborator

When running the tool, you can pass the working directory from where it runs. I believe when Tailwind tries to resolve the plugins, it'll resolve the plugins through the Node module system so as long as those plugins are resolvable from that directory, it should work. For example:

node_modules/
  @tailwindcss/
    aspect-ratio
tailwind.config.js

With the above directory structure, Tailwind should be able to resolve the plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants