angular tailwind authpanel

:clipboard: Angular app using Webpack & Tailwindcss components to display a login dashboard

3
1
JavaScript

⚡ Angular Tailwind Auth Panel

GitHub repo size
GitHub pull requests
GitHub Repo stars
GitHub last commit

📄 Table of contents

📚 General info

  • Webpack explained in Webpack documentation Concepts
  • To build for production Tailwind’s purge option is used to tree-shake unused styles and optimize final build size.
  • angular.json file modified to use custom builder and webpack.config.js file

📷 Screenshots

Example screenshot

📶 Technologies

  • Angular framework v16
  • Webpack v5 static module bundler for modern JavaScript applications.
  • Tailwindcss v3 CSS framework
  • postcss-loader v7 Loader to process CSS with PostCSS. Transformations that are applied to the source code of a module, to pre-process files as you import or “load” them.
  • postcss-scss v4 SCSS parser for PostCSS.
  • ngx-build-plus v16 to extend the Angular CLI’s default build behavior. Allows a partial custom webpack config. to be merged with the CLI’s one.

💾 Setup

  • Run npm i to install dependencies.
  • Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
  • Run npm run build to build the project. The build artifacts will be stored in the dist/ directory.

🔧 Testing

  • Run ng test to run Jasmine unit tests via Karma
  • Run ng e2e to execute the end-to-end tests via Protractor.

💻 Code Examples

  • extract from app.component.html showing tailwindcss used to style input checkbox & label
<div class="flex items-center">
  <input
    id="remember_me"
    name="remember_me"
    type="checkbox"
    class="w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500"
  />
  <label for="remember_me" class="block ml-2 text-sm text-gray-900">
    Remember me
  </label>
</div>

🆒 Features

  • Tailwindcss sign-in form component simply copy-pasted into app.
  • Build file is a compact 244kb thanks to Tailwind’s purge option (manually enabled in tailwind.config.js) that tree-shakes unused styles and optimizes the final build size.

📋 Status & To-Do List

  • Status: Working.
  • To-Do: Nothing

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact