Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/softberry/imgsvg


https://github.com/softberry/imgsvg

css image svg vector-graphics

Last synced: 24 days ago
JSON representation

Awesome Lists containing this project

README

        

# imgsvg

[![imgsvg](https://img.shields.io/npm/v/imgsvg.svg?style=for-the-badge)]()
[![npm](https://img.shields.io/npm/l/imgsvg.svg?style=for-the-badge)]()
[![GitHub last commit](https://img.shields.io/github/last-commit/softberry/imgsvg.svg?style=for-the-badge)]()

Get in contact for help from developer:

[![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/emresakarya?utm_source=github&utm_medium=button&utm_term=emresakarya&utm_campaign=github)

include svg images simply in ```` tag and give it data attribute ``data-imgsvg``.
All those elements will be replaced with ```` vector graphics.

## Why imgsvg

**CSS** can animate and style ``svg`` files but they should not be included in ``img`` .
With this small utility, you can now include ``svg`` images in ``img`` tags but still can use advantages of **css** .

If you place an image like this :

``This is an circle``

it will be converted into :



## Advantages

- Place your vector graphics in simpler form but keep using the advantages of nativ behavior of **svg**.
- Content Management Systems usually let editors to add images always in ```` tags. This is not a pitfall anymore.

## How to use it:

Download minified snipped from ``dist/imgsvg.min.js`` and serve it with your other files. And simply add in to you ``html`` files.

**PS** Images must have ``data-imgsvg`` attribute and file suffix must be ``.svg`` .

**Sample HTML Page**






Sample page img2svg


A sample image