All Projects â†’ notiz-dev â†’ ngx-tailwind

notiz-dev / ngx-tailwind

Licence: MIT license
💹 Simple Angular schematic that initializes Tailwind CSS in your project and adds a custom webpack config to your build process.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to ngx-tailwind

Twin.macro
đŸŠč‍♂ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, stitches and goober) at build time.
Stars: ✭ 5,137 (+4180.83%)
Mutual labels:  tailwind, tailwind-css
tailwind
Website clones/examples using Tailwind CSS.
Stars: ✭ 49 (-59.17%)
Mutual labels:  tailwind, tailwind-css
tailwind-dashboard-template
Mosaic Lite is a free admin dashboard template built on top of Tailwind CSS and fully coded in React. Made by
Stars: ✭ 1,662 (+1285%)
Mutual labels:  tailwind, tailwind-css
tailwind-ui-components
Free Tailwind CSS UI Components - Crafted for modern websites, landing pages and web apps. TailGrids Core is free and open-source so, feel free to use with your personal or commercial projects. If you would like to show your support and love, don't forget to give us a star 🌟
Stars: ✭ 49 (-59.17%)
Mutual labels:  tailwind, tailwind-css
create-nuxt-tailwind-app
[DEPRECATED] Use create-nuxt-app, they added full tailwindcss & purgecss support
Stars: ✭ 32 (-73.33%)
Mutual labels:  tailwind, tailwind-css
cra-tailwindcss
Integrate Tailwind CSS in a Create React App setup
Stars: ✭ 105 (-12.5%)
Mutual labels:  tailwind, tailwind-css
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+15%)
Mutual labels:  tailwind, tailwind-css
eslint-plugin-tailwind
ESLint rules for Tailwind CSS
Stars: ✭ 97 (-19.17%)
Mutual labels:  tailwind, tailwind-css
notus-angular
Notus Angular: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 148 (+23.33%)
Mutual labels:  tailwind, tailwind-css
notus-js
Notus JS: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 191 (+59.17%)
Mutual labels:  tailwind, tailwind-css
play-tailwind
Play is free and open source Tailwind CSS template for - Startup, SaaS, Apps, Business and More. It comes with a high-quality design and all essential components & pages you need to launch a complete website.
Stars: ✭ 60 (-50%)
Mutual labels:  tailwind, tailwind-css
tailwindcss-background-extended
All of the missing background utilities for Tailwind CSS.
Stars: ✭ 25 (-79.17%)
Mutual labels:  tailwind, tailwind-css
memento-svelte-electron-typescript
Template to create a desktop app with Svelte, TailwindCSS, Electron and TypeScript (with electron-updater, electron-reload and electron-builder)
Stars: ✭ 27 (-77.5%)
Mutual labels:  tailwind, tailwind-css
Next-JS-Landing-Page-Starter-Template
🚀 Free NextJS Landing Page Template written in Tailwind CSS 3 and TypeScript âšĄïž Made with developer experience first: Next.js 12 + TypeScript + ESLint + Prettier + Husky + Lint-Staged + VSCode + Netlify + PostCSS + Tailwind CSS
Stars: ✭ 521 (+334.17%)
Mutual labels:  tailwind, tailwind-css
tailwindcss-postcss-browsersync-boilerplate
Tailwind CSS + PostCSS + BrowserSync boilerplate
Stars: ✭ 28 (-76.67%)
Mutual labels:  tailwind, tailwind-css
github-markdown-tailwindcss
â›” Replicate GitHub Flavored Markdown with Tailwind CSS components
Stars: ✭ 100 (-16.67%)
Mutual labels:  tailwind, tailwind-css
tailwind-color-alpha
Automatic alpha variants for your Tailwind CSS colors based on your opacity config
Stars: ✭ 21 (-82.5%)
Mutual labels:  tailwind, tailwind-css
material-tailwind
@material-tailwind is an easy-to-use components library for Tailwind CSS and Material Design.
Stars: ✭ 861 (+617.5%)
Mutual labels:  tailwind, tailwind-css
covid-19-stats
Get the latest COVID-19 statistics by country
Stars: ✭ 41 (-65.83%)
Mutual labels:  tailwind, tailwind-css
axiom
Axiom - A Hugo Theme. GitTip: https://gitcoin.co/tip?username=jhauraw
Stars: ✭ 67 (-44.17%)
Mutual labels:  tailwind, tailwind-css

Tailwind CSS Schematics

npm version Schematics CI

Simple Angular schematic initializing Tailwind CSS in your project. Angular v11.2 includes native support for Tailwind CSS.

For all versions before Angular v11.2 a custom webpack config is added to your build process.

Installation

Run

ng add ngx-tailwind

# or

ng add ngx-tailwind --project <MY_PROJECT>

Example output

The package ngx-tailwind@dev will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
? Which stylesheet format are you using? SCSS [ https://sass-lang.com/documentation/syntax#scss ]
? Which @tailwindcss plugins do you want to install? typography
CREATE tailwind.config.js (236 bytes)
UPDATE package.json (1095 bytes)
UPDATE src/styles.scss (177 bytes)
✔ Packages installed successfully.

Upgrade Guide

Tailwind CSS v2 to v3

To upgrade your project from Tailwind CSS v2 to v3.

npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

Update your tailwind.config.js to the new JIT Engine.

module.exports = {
- // mode: 'jit',
- purge: ['./src/**/*.{html,ts}'],
+ content: ['./src/**/*.{html,ts}'],
- darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
- variants: {
-   extend: {},
- },
  plugins: [],
};

Remove production build script from package.json, which was used for purging unused styles. Since JIT Engine generates only used styles this script is not necessary anymore.

{
  "name": "angular-workspace",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
-   "build:prod": "cross-env NODE_ENV=production ng build --configuration production"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.0.3",
    "@angular/common": "~13.0.3",
    "@angular/compiler": "~13.0.3",
    "@angular/core": "~13.0.3",
    "@angular/forms": "~13.0.3",
    "@angular/platform-browser": "~13.0.3",
    "@angular/platform-browser-dynamic": "~13.0.3",
    "@angular/router": "~13.0.3",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.1",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.0.4",
    "@angular/cli": "~13.0.4",
    "@angular/compiler-cli": "~13.0.3",
    "@types/node": "^12.11.1",
    "autoprefixer": "^10.4.1",
-   "cross-env": "^7.0.3",
    "postcss": "^8.4.5",
    "tailwindcss": "^3.0.8",
    "typescript": "~4.4.4"
  }
}

Migrate from Tailwind CSS

To upgrade you project from Tailwind CSS v1.x to v2.0 run the following install command

npm i -D tailwindcss@latest autoprefixer@latest postcss@latest postcss-import@latest postcss-loader@latest

# using scss
npm i -D postcss-scss@latest

Read the full Upgrade Guide to update your custom tailwind.config.js (e.g. your color palette) and replace removed classes from your template (e.g. shadow-outline and shadow-xs).

Additional options

You can pass additional flags to customize the schematic. For example, if you want to install a different version for Tailwind use --tailwindVersion flag:

ng add ngx-tailwind --tailwindVersion 3.0.8

All available flags:

| Flag | Description | Type | Default | | ---------------------- | -------------------------------------------------------------- | --------------- | ----------------------------------------------------- | --- | | autoprefixerVersion | The autoprefixer version to be installed. | string | ^10.4.1 | | cssFormat | The file extension or preprocessor to use for style files. | css | scss | css | ‚ | | project | The project to initialize with Tailwind CSS. | string | First Angular project | | postcssVersion | The postcss version to be installed. | string | ^8.4.5 | | | tailwindVersion | The Tailwind version to be installed. | string | ^3.0.8 | | disableCrossPlatform | Set the build:prod script to be only UNIX compatible. | boolean | false | | crossEnvVersion | The cross-env version to be installed. | string | ^7.0.3 | | tailwindPlugins | @tailwindcss plugins installed and added to tailwind.config.js | string[] | [aspect-ratio, forms, line-clamp, typography] |

Advanced usage

ng add ngx-tailwind --cssFormat scss --tailwindVersion 3.0.8 --postcssVersion 8.4.5

Want to integrate Tailwind CSS with Angular 11.1 or lower? No problem:

By default, cross-env is added to the build:prod script to be able to set NODE_ENV=prod cross-platform. If you want to override the default behavior, you can set the flag --disableCrossPlatform:

ng add ngx-tailwind --disableCrossPlatform

Developing

Install @angular-devkit/schematics-cli to be able to use schematics command

npm i -g @angular-devkit/schematics-cli

Now build the schematics and run the schematic.

npm run build
# or
npm run build:watch

# dry-run in angular-workspace
npm run start:dev

# execute schematics in angular-workspace
npm run start
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].