Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createStyleSheet.addStyle #13

Open
lindelwa122 opened this issue Sep 28, 2023 · 1 comment
Open

createStyleSheet.addStyle #13

lindelwa122 opened this issue Sep 28, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers to do Feature is required

Comments

@lindelwa122
Copy link
Owner

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:

  • element: HTMLElement
  • declaration: object

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.

@lindelwa122 lindelwa122 added enhancement New feature or request good first issue Good for newcomers to do Feature is required labels Sep 28, 2023
@dipesh2508
Copy link
Contributor

I've raised a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers to do Feature is required
Projects
None yet
Development

No branches or pull requests

2 participants