:zap: Angular Tailwind Auth Panel

:page_facing_up: Table of contents
:books: 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
:camera: Screenshots
:signal_strength: Technologies
:floppy_disk: 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.
:wrench: Testing
- Run
ng test
to run Jasmine unit tests via Karma
- Run
ng e2e
to execute the end-to-end tests via Protractor.
:computer: 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>
:cool: 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.
:clipboard: Status & To-Do List
- Status: Working.
- To-Do:Fix `__webpack_require__(...).context is not a function``error when running Jasmine testing
:clap: Inspiration
:file_folder: License
- This project is licensed under the terms of the MIT license.