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

[Question] VechaiUI didn't style the components? #22

Closed
samzhangjy opened this issue Jul 8, 2021 · 3 comments · Fixed by #23
Closed

[Question] VechaiUI didn't style the components? #22

samzhangjy opened this issue Jul 8, 2021 · 3 comments · Fixed by #23

Comments

@samzhangjy
Copy link

Hello. I followed the steps in the documentation and tried to install VechaiUI. However, when I run the app, the components aren't styled:

image.png

First, I created a blank project using npx create-react-app.

Then I installed the library using yarn:

yarn add @vechaiui/core @vechaiui/react @tailwindcss/forms

And I'm using the very same code as shown in the documentation:

// ./src/App.js
import * as React from "react";
import { VechaiProvider, Button } from "@vechaiui/react";

function App() {
  return (
    <VechaiProvider>
      <Button>Hello Vechai</Button>
    </VechaiProvider>
  );
}

export default App;

And my tailwind.config.js is also copied from the docs:

module.exports = {
  theme: {
    mode: "jit",
    purge: [
      //
      "./node_modules/@vechaiui/**/*.{js,ts,jsx,tsx}", // path to vechaiui
    ],
    darkMode: "class",
    // ...
  },
  // add VechaiUI plugin
  plugins: [
    require("@tailwindcss/forms"),
    require("@vechaiui/core"),
    // ...
  ],
};

The buttons have the btn btn-md btn-outline classes, and everything seem to work, except the style... (sorry for this terrible English...)

Sorry if I misunderstood something in the docs.... I'm actually a beginner in React. I just can't find a solution for this one...

@pepelele
Copy link
Contributor

pepelele commented Jul 8, 2021

@samzhangjy oops sorry my I copied wrong config
tailwind.config.js should be:

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

I put all config in theme 😂

@pepelele
Copy link
Contributor

pepelele commented Jul 8, 2021

You must include Tailwind in your CSS... more about tailwind document https://tailwindcss.com/docs/installation#include-tailwind-in-your-css

@samzhangjy
Copy link
Author

samzhangjy commented Jul 8, 2021 via email

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

Successfully merging a pull request may close this issue.

2 participants