New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bem-modules

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bem-modules

BEM classname transformer for CSS modules.

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
2
Maintainers
0
Weekly downloads
 
Created
Source

bem-modules

BEM classname transformer for CSS modules.

Quick Start

To get started, you need to install the package:

npm install bem-modules --save-dev

And use it in your components:

/* components/Card/Card.module.sass */

.card {
    color: white;
    background-color: blue;

    &--variant {
        &-red {
            background-color: red;
        }
    }

    &__title {
        color: green;
        font-size: 1.5rem;

        &--small {
            font-size: 1rem;
        }
    }
}
// components/Card/Card.tsx

import { transformer } from "bem-modules";

import styles from "./Card.module.sass";

const bem = transformer(styles);

export const Card = () => {
    return (
        <div className={bem({ variant: "red" })}>
            <div className={bem("title")}>Card Title</div>
            <div className={bem("title", { small: true })}>Small Card Title</div>
        </div>
    );
};

Keywords

css

FAQs

Package last updated on 09 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts