feather-icons-vue
Easy to use vue wrapper around feather icons, inheriting color and size from css cascade.
The whole deal about feather-icons-vue
is that style context color and size
are inherited.
This is a big text with a big icon <!-- Icon is big and has blue color by default because its within an h1 context with blue color. --><!-- Default css cascade/inheritance applies --><!-- --><!-- If you'd explicitly like to have a different colored/sized icon, you can specify icon style with css --> This is a big text with a big icon <!-- --><!-- or with style instead of class --> This is a big text with a big icon
I decided to make a new one because I like to think of elements (even icons) styling purely in terms of css, no need for passing in props to specify size or color.
Install
yarn add feather-icons-vue# or npm install feather-icons-vue
Usage
Vue// you can also pass an option object with a custom nameVue// or in specific components components: IconBase
then do
or or if you specified 'as' in options above, you can do or
Sizes
By default, icons will be sized based on the current element's font-size (or propagated parent font-size) Simply set the icon font-size as desired (either by adding css or styling directly)
feather-icons-vue
ships with some default classes (for sizing), you can apply like so:
<!-- font-size: 0.5rem --><!-- font-size: 0.7rem --><!-- font-size: 1.5rem --><!-- font-size: 2rem --><!-- font-size: 4rem -->
Attributes work also (note this is not a prop, attribute will be attached to root svg element):
<!-- font-size: 0.5rem --><!-- font-size: 0.7rem --><!-- font-size: 1.5rem --><!-- font-size: 2rem --><!-- font-size: 4rem -->
Colors
By default, icons will take the parent's color
, you can explicitly specify icon color by simply adding a color class, like so:
<!-- font-size: 0.5rem -->
then define .blue-icon
class
Styles
You can style icons directly also, instead of classes or size attributes
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
feather-icons-vue © damafeez, Released under the MIT License.
Authored and maintained by damafeez with help from contributors (list).