Skip to content

WordPress plugin to add Blade SVG to Sage 9

Notifications You must be signed in to change notification settings

hybridvision/blade-svg-sage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blade SVG for Sage

Latest Stable Version Total Downloads

Blade SVG for Sage is a wrapper for Blade SVG by Adam Wathan allowing you to easily use SVG's in your Blade templates, either as inline SVG or using SVG sprites when using Sage 9.

Installation

Composer

Install via Composer from your theme directory:

$ composer require log1x/blade-svg-sage

Setup

Edit app/filters.php on your Sage theme and use these filters to modify the default configuration (as in the examples below):

add_filter('bladesvg_spritesheet_path', function () {
    return \BladeSvgSage\get_dist_path('images/svg/icons');
});
add_filter('bladesvg_image_path', function () {
    return \BladeSvgSage\get_dist_path('images/svg/icons');
});
add_filter('bladesvg_inline', function () {
    return true;
});
add_filter('bladesvg_class', function () {
    return 'svg';
});
add_filter('bladesvg_sprite_prefix', function () {
    return '';
});

Usage

<ul>
  <li>@svg('phone')</li>
  <li>{{ \BladeSvgSage\svg_image('phone-alt') }}</li>
</ul>

For more examples of usage, please refer to the original blade-svg readme.

About

WordPress plugin to add Blade SVG to Sage 9

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%