css-dynamic-class

1.0.5 • Public • Published

css-dynamic-class is a library for developers that enables them to create custom CSS styles using JavaScript. The createStyles hook automatically generates unique CSS class names from a styles object, making it easy to create dynamic styles that adapt to component state or specific conditions.

Installation

To install the project, follow these steps:

1- Install package: npm install css-dynamic-class --save or yarn install css-dynamic-class
2- Navigate to the project directory: cd project-name
3- Start the development server: npm start or yarn start

Getting started with css-dynamic-class

Here is an example of a basic app using css-dynamic-class Button component:

import { useStyles } from 'css-dynamic-class';

const styles = {
    myButton: {
        backgroundColor: 'blue',
        color: 'white',
        padding: '10px'
    }
}

function Button() {
    const classes = useStyles(styles);
    return <button className={classes.myButton}>Click me</button>
}

Package Sidebar

Install

npm i css-dynamic-class

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

3.68 kB

Total Files

3

Last publish

Collaborators

  • fawadpro