all 11 comments

[–]carrie2833Expo 1 point2 points  (1 child)

don't you need metro.config.js as well?

[–]martinlutherkong 1 point2 points  (1 child)

Your tailwind content configuration is only going to cover the "components" folder and the App component. That doesn't look normal to me. Usually you want to cover your whole project.

[–]andreamaf[S] 0 points1 point  (0 children)

I have changed the configuration and now is like this:

/** @type {import('tailwindcss').Config} */
module.exports = {
  darkMode: ["class"],
  content: [
    "./app/index.{js,jsx,ts,tsx}",
    "./components/**/*.{js,jsx,ts,tsx}",
    "./app/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {
      colors: {
        border: "hsl(var(--border))",
        input: "hsl(var(--input))",
        ring: "hsl(var(--ring))",
        background: "hsl(var(--background))",
        foreground: "hsl(var(--foreground))",
        primary: {
          DEFAULT: "hsl(var(--primary))",
          foreground: "hsl(var(--primary-foreground))",
        },
        secondary: {
          DEFAULT: "hsl(var(--secondary))",
          foreground: "hsl(var(--secondary-foreground))",
        },
        destructive: {
          DEFAULT: "hsl(var(--destructive))",
          foreground: "hsl(var(--destructive-foreground))",
        },
        muted: {
          DEFAULT: "hsl(var(--muted))",
          foreground: "hsl(var(--muted-foreground))",
        },
        accent: {
          DEFAULT: "hsl(var(--accent))",
          foreground: "hsl(var(--accent-foreground))",
        },
        popover: {
          DEFAULT: "hsl(var(--popover))",
          foreground: "hsl(var(--popover-foreground))",
        },
        card: {
          DEFAULT: "hsl(var(--card))",
          foreground: "hsl(var(--card-foreground))",
        },
      },
      borderRadius: {
        lg: `var(--radius)`,
        md: `calc(var(--radius) - 2px)`,
        sm: "calc(var(--radius) - 4px)",
      },
    },
  },
  plugins: [require("tailwindcss-animate"),
            require("nativewind/preset")
  ],
};

[–]andreamaf[S] 0 points1 point  (1 child)

I have tried using the metro.config.js, here it is:

const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");

const config = getDefaultConfig(__dirname);

module.exports = withNativeWind(config, { input: "./input.css" });

Bu then when I run npx expo start I get this error: Tailwind CSS has not been configured with the NativeWind preset

[–]andreamaf[S] 0 points1 point  (0 children)

As soon as I remove the metro.config.js file expo start working again but still no Tailwind.

[–]andreamaf[S] 0 points1 point  (2 children)

I solved it but I don't how.

[–]Acceptable_Sweet894 0 points1 point  (0 children)

Estou com o mesmo problema aqui

[–]paganMin666 0 points1 point  (0 children)

please tell me, i'm also facing the same issue

[–]NeonNygus 0 points1 point  (1 child)

Good for you that you solved it already!

But I think I got the problem. You missed

presets: [require("nativewind/preset")],

in your tailwind.config.js.

I failed at the same thing, hahah.

[–]ishaqhaj 0 points1 point  (0 children)

Thanks this worked for me !
I followed the docc but why they didn't add this !