
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
tailwind-svg-import
Advanced tools
This project adds handling for file system SVGs into Tailwind content.
The goal of the project is to allow you to provide Tailwind a directory and add those directly to utilities or components based on mode. It also optionally allows for SVGs to be colorized with additional configuration.
# Using npm
npm install tailwind-svg-import --save-dev
# Using Yarn
yarn add tailwind-svg-import -D
tailwind.config.js
file:// tailwind.config.js
module.exports = {
// ...
plugins: [require('tailwind-svg-import')],
};
This plugin doesn't make any opinions about where your assets are stored in your
system. For this to work, the files must be available locally. It is recommended
you use a tool such as SVGO to preconfigure your
SVG files. If you wish to use the colorize
option, the SVG file must contain
currentColor
on the SVG attribute you wish to colorize.
Note that this plugin operates by replacing that value with each value in the
color
configuration. Sample SVGO config from
@tailwindlabs/heroicons:
'plugins':
- 'removeDimensions': true
- 'removeXMLNS': false
- 'sortAttrs': true
- 'removeAttrs':
attrs: 'fill'
- 'addAttributesToSVGElement':
attributes:
- 'fill': 'currentColor'
All options are optional and will merge and overwrite default options.
colors
: Object. Define the colors you wish to use for colorize.colorize
: Boolean. Optionally replace currentColor
in your SVG with
provided colors.dirs
: Object. The file directories this plugin should scan.mode
: String (all|vars|utils). Add CSS vars or SVGs, utility classes, or
both.The mode setting is used to decide how the plugin operates:
background-image
utility classesIn 'vars' or 'all' mode, this plugin will create CSS Variables in the following format:
--icon-{name}-{directory}-{color}: url('{contents}')
In 'utils' or 'all' mode, this plugin will create utility classes in the following format:
.icon-{name}-{directory}-{color} {
background-image: url('{contents}')
}
In each example, the {directory}
names are only appended if there are more
than one directory in the dirs
configuration whereas the {color}
name is
appended only if the colorize
option is set to true.
Note that utils mode is purged, whereas vars are added to :root
and are not
purged.
All keys are optional and will resolve to the contents of
src/defaultOptions.js
if no user options are chosen. User and Default options
are merged with preference for user options.
module.exports = {
svgs: {
colors,
colorize: false,
dirs: {
outline,
solid,
},
mode,
},
};
By default this plugin provides 10 Tailwind Heroicons to keep the initial size of the package small and to demonstrate what the plugin can do. However, it's best to use your own icons for this plugin. Tailwind’s Heroicons are a great start if you don’t have specific assets generated by design. We do recommend only including the icons you need as the CSS vars that this plugin uses can’t be purged.
Clone the repository:
git clone https://github.com/jryanconklin/tailwind-svg-import tailwind-svg-import
cd tailwind-svg-import
Install the dependencies:
# Using npm
npm install
# Using Yarn
yarn
Add as a plugin to your project.
FAQs
Import your file system svgs to Tailwind.
We found that tailwind-svg-import 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.