From 6dc36a3a55977c4e3dd50eec5292772063ca97a6 Mon Sep 17 00:00:00 2001 From: Sivert Date: Wed, 15 Mar 2023 11:08:39 +0100 Subject: [PATCH] Update structure --- README.md | 43 +++++++++++++++++++-------- src/styles/globals.scss => style.scss | 2 -- src/styles/tailwind.js => tailwind.js | 0 tsconfig.json | 15 ++-------- 4 files changed, 33 insertions(+), 27 deletions(-) rename src/styles/globals.scss => style.scss (98%) rename src/styles/tailwind.js => tailwind.js (100%) diff --git a/README.md b/README.md index 174802f..6ce4d92 100644 --- a/README.md +++ b/README.md @@ -14,27 +14,24 @@ or yarn add @gryt/ui @tailwindcss/typography tailwind daisyui ``` -## Usage - -### Button - -```tsx -// somePage.tsx -import React, { Component } from 'react' +### Tailwind preset -import Button from '@gryt/ui' +```ts +// tailwind.config.js -class Example extends Component { - render() { - return - } +module.exports = { + presets: [ + require('@gryt/ui/tailwind') + ], + // ... } ``` -### Add styling (including tailwind config) +### Styling ```tsx // _app.tsx + import { AppProps } from 'next/app'; import "@gryt/ui/src/styles/globals.scss"; @@ -43,6 +40,26 @@ function MyApp({ Component, pageProps }: AppProps<{ initialSession: Session }>) } ``` +## Usage + +### Button + +```tsx +// somepage.tsx + +import React, { Component } from 'react' +import Button from '@gryt/ui' + +export default function SomePage() { + return ( +
+

Welcome!

+ +
+ ); +} +``` + ## License MIT © [Gryt-chat](https://github.com/Gryt-chat) diff --git a/src/styles/globals.scss b/style.scss similarity index 98% rename from src/styles/globals.scss rename to style.scss index ed2eb81..0d2c181 100644 --- a/src/styles/globals.scss +++ b/style.scss @@ -1,5 +1,3 @@ -@config "./tailwind.js"; - @tailwind base; @tailwind components; @tailwind utilities; diff --git a/src/styles/tailwind.js b/tailwind.js similarity index 100% rename from src/styles/tailwind.js rename to tailwind.js diff --git a/tsconfig.json b/tsconfig.json index 66e34d8..99f779f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,7 @@ "compilerOptions": { "outDir": "dist", "module": "esnext", - "lib": [ - "dom", - "esnext" - ], + "lib": ["dom", "esnext"], "moduleResolution": "node", "jsx": "react", "sourceMap": true, @@ -28,12 +25,6 @@ "isolatedModules": true, "noEmit": true }, - "include": [ - "src" - ], - "exclude": [ - "node_modules", - "dist", - "example" - ] + "include": ["src", "tailwind.js", "tailwind.js"], + "exclude": ["node_modules", "dist", "example"] }