79370140

Date: 2025-01-20 02:09:24
Score: 1
Natty:
Report link

I'm using nuxtjs with tailwind module and have same problem, following steps work for me.

  1. Change tailwind.config.js to .ts, and replace @type {import('tailwindcss').Config} with satisfies Config like this.
import type { Config } from 'tailwindcss';
import colors from 'tailwindcss/colors';

export default {
  content: [],
  theme: {
    extend: {
      colors: {
        primary: { ...colors.sky, DEFAULT: colors.sky['500'] }
        //...
      }
    }
  },
  plugins: []
} satisfies Config;
  1. Other ts file that use config
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfigRaw from '@/tailwind.config';
const tailwindConfig = resolveConfig(tailwindConfigRaw);
tailwindConfig.theme.colors.primary.DEFAULT // hover will show: (property) DEFAULT: "#0ea5e9" 

hope this help :D

Reasons:
  • Whitelisted phrase (-1): hope this help
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have same problem
  • Low reputation (0.5):
Posted by: bigiCrab