@g123jp/g123-ui
v2.5.13
Published
Reuseable UI based on G123 Design System
Downloads
987
Keywords
Readme
Reuseable UI based on G123 Design System and Atomic Design
📦 Install
yarn add @g123jp/g123-ui
🔨 Usage
make sure tailwindcss has been installed correctly.
make sure Tailwind's default style has been loaded correctly.
# in your root css @tailwind base; @tailwind components; @tailwind utilities;
make sure postcss has been configured correctly(if you use TailwindCSS as a PostCSS plugin).
import g123-ui's config as default(use tailwindcss's presents)
import { g123TailwindPresets } from '@g123jp/g123-ui'; const TailwindConfig = { // use g123-ui's presets as default presets: [g123TailwindPresets], content: [ // ... put your content here './node_modules/@g123jp/g123-ui/dist/components/**/*.js', './node_modules/@g123jp/g123-ui/dist/utils/**/*.js', ], // ... your other configs };
use g123-ui's component:
import { Button, ButtonType, Logo } from '@g123jp/g123-ui'; const App = () => ( <> <Logo /> <Button type={ButtonType.primay}>Submit</Button> </> );
🌛 Dark Mode:
g123-ui supports the system's dark mode by default(uses the
prefers-color-scheme
CSS media feature).But you can also build sites that support toggling dark mode manually using the ‘class’ strategy.
Or use your own customize the dark mode selector, for example, add the following code in your
tailwind.config.js
and control dark mode by addingdata-mode="g123-dark"
to your<html>
tag:
darkMode: ['class', '[data-mode="g123-dark"]'];
⌨️ Development
install
yarn
build
⛑: Make sure to run build before publishing it.
yarn build
🤹🏼 check with storybook
yarn storybook
bundle visualize and analyze with rollup-plugin-visualizer
yarn build
then open
stats/network/index.html
orstats/treemap/index.html
in your browser.