0.6.2 • Published 5 months ago

@creativecodeco/ui v0.6.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@creativecodeco/ui

CreativeCode.com.co

System Design CreativeCode.com.co

NPM TypeScript React Tailwindcss Daisyui Postcss Storybook

Chromatic

View Components

Configuration

Install

npm install @creativecodeco/ui

or

yarn add @creativecodeco/ui

Dependencies

npm install --save-dev tailwindcss postcss postcss-import autoprefixer usehooks-ts cssnano

or

yarn add -D tailwindcss postcss postcss-import autoprefixer usehooks-ts cssnano

Setting Tailwind

Create file tailwind.config.js and add

/** @type {import('tailwindcss').Config} */
import { creativeCodeTheme } from '@creativecodeco/ui';

const themeConfig = {
  ...creativeCodeTheme,
  content: [
    ...creativeCodeTheme.content,
    './src/**/*.{js,jsx,ts,tsx}',
    './app/**/*.{js,jsx,ts,tsx}',
  ],
};

export default themeConfig;

Custom theme

/** @type {import('tailwindcss').Config} */
import { creativeCodeTheme } from '@creativecodeco/ui';

const themeConfig = {
  ...creativeCodeTheme,
  content: [
    ...creativeCodeTheme.content,
    './src/**/*.{js,jsx,ts,tsx}',
    './app/**/*.{js,jsx,ts,tsx}',
  ],
  daisyui: {
    ...creativeCodeTheme.daisyui,
    themes: [
      {
        customTheme: {
          ...require('daisyui/src/theming/themes')['light'],
          primary: '#08448c',
          secondary: '#427AA1',
          neutral: '#EBF2FA',
          accent: '#679436',
          other: '#A5BE00',
        },
      },
    ],
  },
};

export default themeConfig;

Setting Postcss

Create file postcss.config.js and add

module.exports = {
  plugins: {
    'postcss-import': {},
    'tailwindcss/nesting': {},
    tailwindcss: {},
    autoprefixer: {},
    ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
  },
};

Setting Provider

Add on layout layout.tsx

import { CreativeCodeUIProvider } from '@creativecodeco/ui';

import '@creativecodeco/ui/lib/theme/css/main.css';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <CreativeCodeUIProvider>
          {children}
        </CreativeCodeUIProvider>
      </body>
    </html>
  );
}

License

MIT © CreativeCode.com.co

Web CreativeCode.com.co

0.6.2

5 months ago

0.6.1

5 months ago

0.6.0

9 months ago

0.5.0

10 months ago

0.4.2

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.0

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago

0.0.3

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.2

1 year ago

0.0.1

1 year ago