feat: Updated replace() to pass id from placeholder element (#193)

This commit is contained in:
Brad Bohen
2017-10-11 17:05:10 -04:00
committed by Cole Bemis
parent b7d22291f1
commit e80f80524a
3 changed files with 11 additions and 7 deletions

View File

@@ -229,13 +229,13 @@ You can pass `feather.replace()` an `options` object:
</script>
```
All classes on a placeholder element (i.e. `<i>`) will be copied to the `<svg>` tag:
The id and classes on a placeholder element (i.e. `<i>`) will be copied to the `<svg>` tag:
```html
<i class="foo bar" data-feather="circle"></i>
<i id="my-circle-icon" class="foo bar" data-feather="circle"></i>
<!--
<i> will be replaced with:
<svg class="feather feather-circle foo bar" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>
<svg id="my-circle-icon" class="feather feather-circle foo bar" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>
-->
<script>