Visitar URL original
Make replaceElement function part of the public API by emirdaponte · Pull Request #1129 · feathericons/feather · GitHub
Skip to content

Make replaceElement function part of the public API - #1129

Open
emirdaponte wants to merge 2 commits into
feathericons:mainfrom
emirdaponte:master
Open

emirdaponte wants to merge 2 commits into
feathericons:mainfrom
emirdaponte:master

Conversation

@emirdaponte

@emirdaponte emirdaponte commented Jan 29, 2022 •

Copy link
Copy Markdown

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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All+L issues páginas Javascript,js Matias.Company Powered by JCM Tools Español México San Mateo Caphuluac Estado De México Toluca 52080 https://www.es.comfiguracion.com/host/MX/Net/ru/do/

1 participant