Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterfox/hieroglyph
A package to simplify changing between different icon sets
https://github.com/peterfox/hieroglyph
Last synced: 5 days ago
JSON representation
A package to simplify changing between different icon sets
- Host: GitHub
- URL: https://github.com/peterfox/hieroglyph
- Owner: peterfox
- License: mit
- Created: 2016-04-26T12:58:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-03T14:49:30.000Z (over 8 years ago)
- Last Synced: 2024-10-12T11:34:37.397Z (about 1 month ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Hieroglyph
==========A simple package for PHP making it easier to switch around the icon sets you use in your markup. There's currently a
lot of different icon sets and changing between them can be a pain. The idea of Hieroglyph is that you can map the
correct icons in your application to the different sets and even apply modifiers without fixing your mark up to using
one icon set.Install
-------You can install via composer
```
composer require peterfox/hieroglyph
```Using Hieroglyph with Laravel
-----Add the Service Provider
```
Hieroglyph\Laravel\HieroglyphServiceProvider::class,
```Add the Facade
```
'Hiero' => Hieroglyph\Laravel\HieroglyphFacade::class,
```Publish the config using artisan
```
php artisan vendor:publish
```Edit the hierogplyph config
```
'font-awesome','font-awesome' => [
'template' => '',
'prefix' => 'fa-',
'icons' => [
// Add icons here .e.g. 'create' => 'pencil' or 'loading' => 'spinner'
],
'modifiers' => [
'spin' => 'spin',
'large' => 'lg',
'twoX' => '2x',
'threeX' => '3x',
'fourX' => '4x',
'fiveX' => '5x',
'fixedWidth' => 'fw',
'button' => 'btn',
]
],
];
```Using the Facade
```
Hiero::glyph('twitter');
Hiero::glyph('instagram')->large();
Hiero::glyph('loading')->large()->spin();
Hiero::glyph('loading')->button()->spin();
Hiero::glyphDecision(true, 'ok', 'wrong')->large();
```Using the Facade in Blade
```
{!! Hiero::glyph('facebook') !!}
{!! Hiero::glyphDecision(true, 'ok', 'wrong')->large() !!}
```Contribute
----------Currently I've only supported what I've personally needed. I'd love to make a twig extension and a Symphony bundle but
currently it's no a requirement for me. I can't really take any requests or suggestions but if you want to do the work
and make a pull request I'll do my best to add it.