Skip to content
This repository was archived by the owner on May 8, 2021. It is now read-only.

Conversation

ognjenjevremovic
Copy link

Adds an example of Tailwind in Angular project with a sample template indicating that the Tailwind is working correctly.

It also provides a detailed setup process on how to add Tailwind into an existing Angular project.

Ognjen Jevremovic added 4 commits February 9, 2021 18:38
Initialize the Angular project, using the latest version of the
@angular/cli (v11.1.4 at the time of writing) and accepting the default
configuration.
Install required dependencies in order to integrate Tailwind.css into
the Angular project. Add `ngx-build-plus` schematics in order to extend
the Angular CLI's default build behavior without ejecting. Create a
webpack.config.js file and provide the minimum Webpack configuration to
configure Postcss with Tailwind.css. Extend the angular build, serve and
test commands to provide extra webpack config to generate Tailwind.css
styles. Generate the Tailwind.css config with `npx tailwindcss init`
command. Add Tailwind.css base styles to the application’s (global)
style.scss file.
Define the sample application template using Tailwind.css classes.
Template / style credits greatly inspired by tailwind.play
(play.tailwindcss.com).
@ognjenjevremovic
Copy link
Author

Hey @adamwathan

I apologize if the repository is not actively maintained anymore, but I wanted to contribute to the project with an Angular example.
Whenever I wanted to include TailwindCSS into an existing Angular project (or start a new one from scratch using the CLIs) I always needed to fiddle around with Webpack and Angular configurations in order to make the two work together seamlessly.
I wanted to have it written up somewhere and what is a better place to be rather than the official Tailwind setup examples 🙂 .

I provided a detailed instructions on how to integrate Tailwind with Angular (latest versions of both, at the time of writing), in the MR in the README.md.
Is there anything that needs changing or improving in order to have this merged to the examples repo?

Many thanks!

@jits
Copy link

jits commented Feb 22, 2021

Note that Angular v11.2 now supports TailwindCSS out of the box.

Related PR: tailwindlabs/tailwindcss.com#759

@ognjenjevremovic
Copy link
Author

Thanks for the heads-up @jits . I was unaware of this change in the Angular v11.2 🙂 .
I'm closing this one then.

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

Successfully merging this pull request may close these issues.

2 participants