Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
svg-icon-inline-loader
Advanced tools
Webpack loader to inline Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file.
A webpack loader that enables inlining Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file into HTML.
npm install --save-dev svg-icon-inline-loader
{
test: /\.html$/,
loader: 'svg-icon-inline'
},
Or with html-loader:
{
test: /\.html$/,
loader: 'html!svg-icon-inline'
},
This loader recognizes 3 types of self-closing tags:
<mat-svg/>
- Inline a Material Design SVG<ion-svg/>
- Inline an Ionicon SVG<iconic-svg/>
- Inline an Iconic SVG<file-svg/>
- Inline an SVG file.<mat-svg category="navigation" name="fullscreen_exit"/>
category
: The category that Material Design specifies for that icon.name
: The name of the icon. If the name is multi-word, it must be separated using underscores.<ion-svg name="ion-arrow-expand"/>
name
: The name of the icon. If the name is multi-word, it must be separated using hyphens.<iconic-svg name="account-login"/>
name
: The name of the icon. If the name is multi-word, it must be separated using hyphens.<file-svg src="./icons/home.svg"/>
src
: The path of the svg file.Any attributes apart from category
, name
, or src
, are retained. For example:
Input
<mat-svg v-if="displayHomeIcon" class="icon-home" category="action" name="home"/>
Output
<svg role="presentation" focusable="false" v-if="displayHomeIcon" class="icon-home" fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"></path>
<path d="M0 0h24v24H0z" fill="none"></path>
</svg>
A11y modifications for SVGs as recommended.
role="presentation"
and focusable="false"
attributes.desc
and title
attributes.SVGO is used to optimize SVGs.
Inlining SVGs enables CSS to be applied to SVGs.
Originally forked from markup-inline-loader. Thank you!
FAQs
Webpack loader to inline Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file.
The npm package svg-icon-inline-loader receives a total of 8 weekly downloads. As such, svg-icon-inline-loader popularity was classified as not popular.
We found that svg-icon-inline-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.