1.0.14 • Published 3 months ago

overclass v1.0.14

Weekly downloads
5
License
MIT
Repository
github
Last release
3 months ago

overclass

Manipulate classNames based on css/scss modules using tagged template strings or simple build directly classNames attribute easily

Use: mySCSSFile.scss

.tracer {
    color: blue;
}
.tracer__nano {
    color: silver;
}

.bastion {
    content: 'robot';
}
.bastion__turret {
    background-color: orange;
}

.hanzo {
    content: '-> -> ->';

    &__arrow-hold {
        content: '------ --- -- ->';
    }
}

.genji {
    color: green;

    &__ultimate {
        display: none;
    }
}

myJavascriptFile.js

import oc, { cn, jn } from 'overclass';

import styles from './mySCSSFile.scss';

<div className={oc(styles)`tracer tracer__nano`} />
<div className={oc(styles)`bastion ${turret && 'bastion__turret'}`} />

const s76 = oc(styles);
<div className={s76`hanzo ${hasTank && 'hanzo__arrow-hold'}`} />
<div className={s76`genji ${hasTank && 'genji__ultimate'}`} />

/* for classnames */
<div className={cn`bastion ${turret && 'bastion__turret'}`} />

/* for joined */
<div className={jn('bastion', turret && 'bastion__turret')} />
1.0.14

3 months ago

1.0.13

3 months ago

1.0.12

3 months ago

1.0.11

11 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

0.1.7

1 year ago

0.1.6

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago