readme.md
March 31, 2024 ยท View on GitHub
@abhijithvijayan/styler
CSS Modules Style Helper
๐โโ๏ธ Made by @abhijithvijayan
โค๏ธ it? โญ๏ธ it on GitHub or Tweet about it.
Table of Contents
Installation
Ensure you have Node.js 18 or later installed. Then run the following:
# via npm
npm install @abhijithvijayan/styler
# or yarn
yarn add @abhijithvijayan/styler
Usage
import Styler from '@abhijithvijayan/styler';
import * as React from 'react';
import styles from './styles.scss';
function App({theme = {}, show = false}) {
const styler = new Styler(styles, theme);
return (
<div className={styler.get("wrapper")}>
<p className={styler.get(["heading", show && "show"])}>hello world</p>
<p className={styler.get(["message"], ["static-class-name"])}>new message</p>
</div>
);
}
API
Issues
Looking to contribute? Look for the Good First Issue label.
๐ Bugs
Please file an issue here for bugs, missing documentation, or unexpected behavior.
Linting & TypeScript Config
- Shared Eslint & Prettier Configuration -
@abhijithvijayan/eslint-config - Shared TypeScript Configuration -
@abhijithvijayan/tsconfig
License
MIT ยฉ Abhijith Vijayan