Skip to content

andreacfromtheapp/elm_vite_tailwind_template

Repository files navigation

Vite, Elm, Tailwind CSS, and daisyUI

Opinionated template for building Elm web applications using Vite, Tailwind CSS, and daisyUI.

Tooling

Vite

Elm

Packages

Shortlist of Elm packages that could be beneficial. Included as suggestions:

To remove them feel free:

  1. not to use them
  2. run npm run review

Tailwind CSS

The official plugins are installed by default:

daisyUI

"The most popular, free and open-source Tailwind CSS component library".

daisyUI: a Tailwind CSS classes component library, aiming to work on all frameworks. The CSS nature of daisyUI makes Elm integration possible and a breeze to use. Examples included:

Node

  • fnm: easily and consistently manage Node.
  • .nvimrc set to use latest lts/iron.

VS Code

Lint/Format

Elm + Tailwind CSS

Get Started

Install tiged

To clone this repository, devoid of .git, you can either use npx degit or install tiged locally and run degit without npx. YMMV.

Tiged is a fork that addresses a number of issues, and should be preferred. To install it, run:

npm uninstall -g degit
npm install -g tiged

Most likely, npx degit would invoke degit. A locally installed binary makes sure you are running tiged instead.

Peruse the template

  1. Clone the template:
    1. using npx: npx degit gacallea/elm_vite_tailwind_template my-elm-app
    2. local binary: degit gacallea/elm_vite_tailwind_template my-elm-app
  2. Enter the project: cd my-elm-app
  3. Install dependencies: npm install
  4. Start developing: npm run dev

Available Commands

script action
postinstall elm-tooling install
dev vite
prebuild elm-tooling install
build vite build
preview npm run build; vite preview
standard standard --fix src/*/.js
markdown standard-markdown --fix src/*/.md
review elm-review --fix-all
test elm-test-rs

Contributing

Contributions and constructive criticism are welcome. If you think I'm overdoing it, feel free to discuss. I'm still experimenting with this, as a learning opportunity, and I strive to improve the template as much as possible.

pre-commit hooks (WIP)

This repo relies on pre-commit-ci to make sure all suggested coding standards are enforced with git hooks. You could also install pre-commit locally to apply the same configuration locally.

Acknowledgements

This templated was inspired by Lindsay K Wardell's template.