lindelwa122 / dom-wizard

JavaScript library that makes DOM manipulation easy and more managable.
MIT License
7 stars 8 forks source link

createStyleSheet.configureStateRule #15

Open lindelwa122 opened 9 months ago

lindelwa122 commented 9 months ago

createStyleSheet.configureStateRule

createStyleSheet

The createStyleSheet module facilitates the creation and application of CSS styles to elements. It's important to note that this module isn't intended to replace traditional CSS, but rather to provide an API for efficiently adding CSS rules to elements using JavaScript when it's the most suitable approach.

createStyleSheet.configureStateRule

The createStyleSheet.configureStateRule function is intended to add styles to an element when it is in a certain state, such as changing the color of a paragraph when it is in the hover state. The function is expected to receive inputs structured like this:

{ 
    "button:hover": {
         backgroundColor: "purple",
    }
}

However, it's important to note that this function is not a priority, and achieving this functionality is more effectively done using CSS. This module is not meant to replace CSS, but to assist developers in adding styles when using CSS is not the most appropriate approach.