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

Make replaceElement function part of the public API #1129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

emirdaponte
Copy link

@emirdaponte emirdaponte commented Jan 29, 2022

I think it would be nice to have more granular control of which icons to replace.

e.g. Replace the icons in two sections of the HTML with different settings.

<section id='first'>
 ...
</section>
<section id='first'>
 ...
</section>

<script>
  const firstSection = document.querySelector('#first')
  const secondSection = document.querySelector('#second')
  
  for (let element of firstSection.querySelectorAll('[data-feather]')) {
    feather.replaceElement(element, { class: 'foo bar', 'stroke-width': 1 })
  }
  
  for (let element of secondSection.querySelectorAll('[data-feather]')) {
    feather.replaceElement(element)
  }
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant