Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Components doesn't work #54

Closed
Mnigos opened this issue Nov 4, 2021 · 9 comments
Closed

Components doesn't work #54

Mnigos opened this issue Nov 4, 2021 · 9 comments

Comments

@Mnigos
Copy link

Mnigos commented Nov 4, 2021

Hi I used the Button component and It didn't apply style on it.

_app.tsx

import React from 'react'
import type { AppProps } from 'next/app'
import { VechaiProvider, Button } from '@vechaiui/react'

export default function App({ Component, pageProps }: AppProps) {
  return (
    <VechaiProvider>
      <Button>e</Button>
      <Component {...pageProps} />
    </VechaiProvider>
  )
}

tailwind.config.ts

export default {
  mode: 'jit',
  purge: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './node_modules/@vechaiui/**/*.{js,ts,jsx,tsx}',
  ],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [require('@tailwindcss/forms'), require('@vechaiui/core')],
}

image

@pepelele
Copy link
Contributor

pepelele commented Nov 5, 2021

You must import tailwind styles in _app.tsx

import '../styles/globals.css';

globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;

You can check basic setup here: https://stackblitz.com/edit/nextjs-pvx8qa?file=pages%2Findex.js

@Mnigos
Copy link
Author

Mnigos commented Nov 5, 2021

Yes I fixed that, and for now I see that tailwindcss styles applies, but venchaui doesn't

@pepelele
Copy link
Contributor

pepelele commented Nov 5, 2021

You can download the demo or playground with stackblitz link ... I don't have enough context to find this bug

@Mnigos
Copy link
Author

Mnigos commented Nov 5, 2021

I see that config i recreated it, and it still doesn't work.

@Mnigos
Copy link
Author

Mnigos commented Nov 7, 2021

Ok, so to fix that error I was forced to create a new project.

@Mnigos Mnigos closed this as completed Nov 7, 2021
@xingxinglieo
Copy link

i meet the same problem, did you solve it ?

Ok, so to fix that error I was forced to create a new project.

@xingxinglieo
Copy link

i forget add VechaiProvider, after adding it, some styles apply, but still any styles didn't work,like color. But i really need a ui library, so i copy all styles from the website vechaiui.com 😂

@mossen
Copy link

mossen commented Feb 12, 2022

This is what you need to have in your tailwind.config.js:

module.exports = {
  mode: 'jit',
  purge: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './node_modules/@vechaiui/**/*.{js,ts,jsx,tsx}', // path to vechaiui
  ],
  plugins: [require('@tailwindcss/forms'), require('@vechaiui/core')],
  darkMode: 'class', // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
}

@xingxinglieo
Copy link

This is what you need to have in your tailwind.config.js:

module.exports = {
  mode: 'jit',
  purge: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './node_modules/@vechaiui/**/*.{js,ts,jsx,tsx}', // path to vechaiui
  ],
  plugins: [require('@tailwindcss/forms'), require('@vechaiui/core')],
  darkMode: 'class', // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
}

Yes, the tailwind.config.js always has the config like this,but some styles don't work
image
the icon is plain

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

No branches or pull requests

4 participants