Skip to content

Drupal module to add a Twig extension to easily include inline SVG in twig templates

Notifications You must be signed in to change notification settings

Capgemini/twig_svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twig_svg

  1. Ensure your icon.svg file exists within the base theme, in the following directory 'your_theme/images/icons.svg'.

  2. To include an SVG icon in a twig template, add the following in the relevant html.twig file:

    {{ icon('icon-name', 'Icon title') }}

Credit to https://www.lullabot.com/articles/better-svg-sprite-reuse-in-drupal-8 for the fundamentals of this.

About

Drupal module to add a Twig extension to easily include inline SVG in twig templates

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages