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
feat(readme): update readMe, update replace method #23
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fff0873
feat(readme): update readMe, add section with animation, available op…
19951a7
Merge branch 'master' into feat/update_doc
25d719b
feat(readme): update readMe, make options description more clear.
576a615
feat(readme): update readMe, make options description more clear.
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -67,6 +67,16 @@ import * as eva from 'eva-icons'; | |||||
``` | ||||||
*Thanks to Feather Icons for the build process inspiration.* | ||||||
|
||||||
- Additional attributes: | ||||||
* `data-eva-fill`: set icon color | ||||||
* `data-eva-height`: set icon height | ||||||
* `data-eva-width`: set icon width | ||||||
* `data-eva-animation`: [set icon animation](#animation) | ||||||
|
||||||
```html | ||||||
<i data-eva="github" data-eva-fill="#ff0000" data-eva-height="48" data-eva-width="48"></i> | ||||||
``` | ||||||
|
||||||
### Fonts | ||||||
|
||||||
Eva Icons are also available as a Web Font. | ||||||
|
@@ -86,9 +96,58 @@ We recommend using SVG icons due to better rendering and performance capabilitie | |||||
|
||||||
## Documentation | ||||||
|
||||||
### `eva.replace({ ... })` | ||||||
### `eva.replace(options)` | ||||||
|
||||||
Replaces all elements that have a `data-eva` attribute with SVG markup. | ||||||
|
||||||
`options` optional object. | ||||||
|
||||||
#### Available 'option' properties: | ||||||
| Name | Type | Default value | Description | | ||||||
|------| ------ | ------------- |-------------| | ||||||
| fill | string | none | Icon color | | ||||||
| width | string or number | 24px | Icon width | | ||||||
| height | string or number | 24px | Icon height | | ||||||
| class | string | none | Custom css class | | ||||||
| animation | object | none | [Icon animation](#animation) | | ||||||
|
||||||
### Animation | ||||||
- Add the `data-eva-animation` attribute with the animation type `(zoom, pulse, shake and flip)` to an element: | ||||||
|
||||||
```html | ||||||
<i data-eva="github" data-eva-animation="zoom"></i> | ||||||
``` | ||||||
|
||||||
- By default animation works by hover and has infinity `false`, if you want change this behavior add `data-eva-hover="true | false"` and `data-eva-infinite="true | false"` | ||||||
|
||||||
```html | ||||||
<i data-eva="github" data-eva-animation="zoom" data-eva-hover="false" data-eva-infinite="true"></i> | ||||||
``` | ||||||
|
||||||
> **Note:** In the above example github icon will be always animated. | ||||||
|
||||||
- Pass animation as property in a `eva.replace` method. | ||||||
|
||||||
```js | ||||||
eva.replace({ | ||||||
aniamtion: { | ||||||
type: string, // zoom, pulse, shake, flip | ||||||
hover: booleam, // default true | ||||||
infinite: boolean, // default false | ||||||
} | ||||||
}); | ||||||
``` | ||||||
> **Note:** The animation will be applied to all replaced elements. | ||||||
|
||||||
- Add class `eva-parent-hover` to parent container if you want that the animation works by hover on the parent element. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```html | ||||||
<div class="eva-parent-hover"> | ||||||
<i data-eva="github" data-eva-animation="zoom"></i> | ||||||
Zoom aniamtion | ||||||
</div> | ||||||
``` | ||||||
|
||||||
Replaces all elements that have a `data-eva` attribute with SVG markup corresponding to the element's `data-eva` attribute value. | ||||||
## License | ||||||
[MIT](LICENSE.txt) license. | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sentence is quite hard to understand, try to rephrase