Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.