lindelwa122 / dom-wizard

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

createStyleSheet.addStyle #13

Open lindelwa122 opened 9 months ago

lindelwa122 commented 9 months ago

createStyleSheet.addStyle

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.

addStyle

Parameters/Inputs:

The addStyle function accepts two parameters: element and declaration. It iterates over the declaration to extract the property and its corresponding value. The function then applies the style to the element using the following syntax: element.style[property] = value.

dipesh2508 commented 8 months ago

I've raised a PR