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

JS: The Creation of Elements #375

Open
tomasznetcentric opened this issue Aug 4, 2023 · 0 comments
Open

JS: The Creation of Elements #375

tomasznetcentric opened this issue Aug 4, 2023 · 0 comments
Labels

Comments

@tomasznetcentric
Copy link
Collaborator

In one of our last PRs we introduced a new function to create elements to our Franklin library.

It is createElement('htmlTag', ['css', 'classes', ...], {properties: value, ...}) in scripts/lib-franklin.js

View createElement() in action on blocks/chapter-cards/chapter-cards.js

This feature helps us to keep our code organized and tidy. Of course, this feature speeds up the development time for future scripts. And in order to keep our code base in one line we need to refactor the current approach to how we create the elements.

So let's find each document.createElement() and their followers like: .classList.add(), .setAttribute() ....
and replace it with one sigle line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant