JSPM

@abhijithvijayan/styler

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q56025F
  • License MIT

CSS Modules Style Helper

Package Exports

  • @abhijithvijayan/styler
  • @abhijithvijayan/styler/lib/cjs/index.js
  • @abhijithvijayan/styler/lib/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@abhijithvijayan/styler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@abhijithvijayan/styler

CSS Modules Style Helper

🙋‍♂️ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


❤️ it? ⭐️ it on GitHub or Tweet about it.

Table of Contents

Installation

Ensure you have Node.js 10 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.

See Bugs

Linting & TypeScript Config

License

MIT © Abhijith Vijayan