Skip to content

Radio and Checkbox lose styling in prod mode #55

Closed
@jacekschae

Description

@jacekschae

I'm wondering what i'm doing wrong 🤔. I have a form with input, radio, select, and checkbox elements. I know that my configuration with @tailwindcss/forms is valid since in dev mode; all form elements are displayed correctly -- with styling.

tailwindcss build ./src/dev/tailwind.css -o ./public/css/main.css

Yet when I run the production

NODE_ENV=production postcss build ./src/dev/tailwind.css -o ./public/css/main.css

I'm losing styling on radio and checkbox elements, select seems to be not impacted and I'm wondering why?

/* tailwind.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
// tailwind.config.js
module.exports = {
  purge: {
    content: ["./public/**/*.html", "./src/main/**/*.cljs"]
  },
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [
    require('@tailwindcss/forms'),
  ],
}
// postcss.config.js
const cssnano = require('cssnano');

module.exports = {
  plugins: [
    require('tailwindcss'),
    require('autoprefixer'),
    cssnano({ preset: 'default' }),
  ]
}

Output when running (all ok):

tailwindcss build ./src/dev/tailwind.css -o ./public/css/main.css

tw-build

Output when running (radio and checkbox lose styling):

NODE_ENV=production postcss build ./src/dev/tailwind.css -o ./public/css/main.css

tw-prod

Any ideas or pointes what I could change to make this work would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions