All Projects → monty5811 → Postcss Elm Tailwind

monty5811 / Postcss Elm Tailwind

Licence: mit
put some tailwind in your elm

Programming Languages

javascript
184084 projects - #8 most used programming language
elm
856 projects

Projects that are alternatives of or similar to Postcss Elm Tailwind

building-realworld-user-interfaces-using-tailwind
Demo of building real-world UIs using TailwindCSS
Stars: ✭ 87 (+8.75%)
Mutual labels:  postcss, tailwindcss
XT-TailwindCSS-Starter
A Tailwind CSS Starter. Based on Tailwind CSS, Webpack, PostCSS, and cssnano. Fully optimized for top performance.
Stars: ✭ 19 (-76.25%)
Mutual labels:  postcss, tailwindcss
hugo-starter-tailwind-basic
A basic and simple to set up Hugo with TailwindCSS starter project.
Stars: ✭ 80 (+0%)
Mutual labels:  postcss, tailwindcss
tailwindcss-postcss-browsersync-boilerplate
Tailwind CSS + PostCSS + BrowserSync boilerplate
Stars: ✭ 28 (-65%)
Mutual labels:  postcss, tailwindcss
Shopify Theme Lab
Shopify theme development environment using Liquid, Vue and Tailwind CSS 🧪
Stars: ✭ 250 (+212.5%)
Mutual labels:  tailwindcss, postcss
vite-ts-tailwind-starter
Opinionated Vite + Vue 3 + TypeScript + Tailwind CSS starter template w/ tests and CI.
Stars: ✭ 228 (+185%)
Mutual labels:  postcss, tailwindcss
sapper-postcss-template
A template that includes Sapper for Svelte and PostCSS preprocessing with Tailwind CSS
Stars: ✭ 84 (+5%)
Mutual labels:  postcss, tailwindcss
A17t
An atomic design toolkit for pragmatists
Stars: ✭ 236 (+195%)
Mutual labels:  tailwindcss, postcss
sapper-template-rollup
Starter Rollup template for Sapper apps using postcss, cssnano, tailwindcss, and svelte-preprocess.
Stars: ✭ 32 (-60%)
Mutual labels:  postcss, tailwindcss
tailwind-airbnb
A demo of how to build Airbnb's home page using Tailwind CSS
Stars: ✭ 39 (-51.25%)
Mutual labels:  postcss, tailwindcss
stencil-tailwind-plugin
Plugin for using tailwindcss with StencilJS
Stars: ✭ 17 (-78.75%)
Mutual labels:  postcss, tailwindcss
Awesome Tailwindcss
😎 Awesome things related to Tailwind CSS
Stars: ✭ 7,791 (+9638.75%)
Mutual labels:  tailwindcss, postcss
postcss-typed-css-classes
PostCSS plugin that generates typed entities from CSS classes for chosen programming language.
Stars: ✭ 12 (-85%)
Mutual labels:  postcss, tailwindcss
tailwind-bootstrap-grid
Tailwind CSS plugin that generates Bootstrap's flexbox grid
Stars: ✭ 96 (+20%)
Mutual labels:  postcss, tailwindcss
tailwind-caret-color
Tailwindcss plugin to color caret in input fields
Stars: ✭ 12 (-85%)
Mutual labels:  postcss, tailwindcss
eleventy solo starter njk
Further development suspended as of 2021-09-11. Please refer instead to https://www.11ty.dev/docs/starter/ for a wide selection of other Eleventy starter sets.
Stars: ✭ 22 (-72.5%)
Mutual labels:  postcss, tailwindcss
Tailwindcss
A utility-first CSS framework for rapid UI development.
Stars: ✭ 50,879 (+63498.75%)
Mutual labels:  tailwindcss, postcss
Sapper Firebase Typescript Graphql Tailwindcss Actions Template
A template that includes Sapper for Svelte, Firebase functions and hosting, TypeScript and TypeGraphQL, Tailwind CSS, ESLint, and automatic building and deployment with GitHub Actions
Stars: ✭ 111 (+38.75%)
Mutual labels:  tailwindcss, postcss
tailpress
A Tailwind CSS enabled Underscores theme
Stars: ✭ 60 (-25%)
Mutual labels:  postcss, tailwindcss
Tailwindcss Dark Mode
🌚 A Tailwind CSS plugin that adds variants for dark mode
Stars: ✭ 649 (+711.25%)
Mutual labels:  tailwindcss, postcss

postcss-elm-tailwind

tailwind + elm = 🚀

See the demo and repo.

Actions Status

view : Model -> Html Msg
view model =
    Html.div [ TW.h_screen, TW.w_screen, TW.flex, TW.justify_center, TW.items_center, TW.bg_gray_200 ]
        [ Html.div []
            [ Html.button
                [ E.onClick Decrement
                , TW.px_2
                , TW.px_4
                , TW.text_white
                , TW.bg_blue_500
                , TW.w_full
                ]
                [ Html.text "-" ]
            , Html.div
                [ TW.text_2xl
                , TW.text_center
                , TW.my_4
                ]
                [ Html.text (String.fromInt model) ]
            , Html.button
                [ E.onClick Increment
                , TW.px_2
                , TW.px_4
                , TW.text_white
                , TW.bg_blue_500
                , TW.w_full
                ]
                [ Html.text "+" ]
            ]
        ]

Installation

yarn add postcss-elm-tailwind --dev

# OR

npm i -D postcss-elm-tailwind

Usage

module.exports = {
  plugins: [
    require("tailwindcss"),
    require("postcss-elm-tailwind")({
      tailwindConfig: "./tailwind.config.js", // tell us where your tailwind.config.js lives
      // only the tailwindConfig key is required, the rest are optional:
      elmFile: "src/Tailwind.elm", // change where the generated Elm module is saved
      elmModuleName: "Tailwind", // this must match the file name or Elm will complain
      nameStyle: "snake", // "snake" for snake case, "camel" for camel case
      splitByScreens: true // generate an Elm module for each screen
    })
  ]
};

See the demo for a full example.

Other output formats

SVG

If you want to use Tailwind classes to style SVG you can output an Svg module like this:

module.exports = {
  plugins: [
    require("tailwindcss"),
    require("postcss-elm-tailwind")({
      tailwindConfig: "./tailwind.config.js",
      elmFile: "src/Tailwind.elm",
      elmModuleName: "Tailwind",
      formats: {
        svg: {
          elmFile: "src/Tailwind/Svg.elm",
          elmModuleName: "Tailwind.Svg"
        }
      }
    })
  ]
};

String

If you want access to the class names themselves, you can output a String module as an escape hatch:

module.exports = {
  plugins: [
    require("tailwindcss"),
    require("postcss-elm-tailwind")({
      tailwindConfig: "./tailwind.config.js",
      elmFile: "src/Tailwind.elm",
      elmModuleName: "Tailwind",
      formats: {
        string: {
          elmFile: "src/Tailwind/String.elm",
          elmModuleName: "Tailwind.String"
        }
      }
    })
  ]
};

Other things to note

In order to get a small build, you'll need to build Tailwind twice - once without purgecss to build TW.elm with all the classes and once with purgecss so that all the unused classes are removed from your production CSS. See how this is implemented in the demo.

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].