Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TailwindCSS Autocomplete from ui #3

Open
Psycarlo opened this issue Jun 21, 2024 · 1 comment
Open

TailwindCSS Autocomplete from ui #3

Psycarlo opened this issue Jun 21, 2024 · 1 comment

Comments

@Psycarlo
Copy link

Hi serkodev

I enjoyed your article very much.

A problem with TailwindCSS is that we don't get autocomplete: on packages/app/app.vue I don't get autocomplete for the 'bg-ui' class, for example.

*Using vsc and Tailwind CSS IntelliSense extension

@Psycarlo
Copy link
Author

My solution was to create yet another package: tailwind-config

package.json

{
  "name": "@nuxt-monorepo/tailwind-config",
  "version": "0.0.0",
  "private": true,
  "devDependencies": {
    "tailwindcss": "^3.4.1"
  }
}

tailwind.config.ts

import { type Config } from 'tailwindcss'

export default <Partial<Config>>{
  theme: {
    extend: {
      colors: {
        brand: {
          primary: '#204B9A',
        }
      },
      fontFamily: {
        brand: ['Inter', 'sans-serif']
      }
    }
  },
  plugins: []
}

I then add this package to ui and app
Use the shared config:

tailwind.config.ts

import sharedConfig from "@nuxt-monorepo/tailwind-config/tailwind.config";
import { type Config } from "tailwindcss";

export default <Partial<Config>>{
  presets: [sharedConfig],
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant