1.0.0 • Published 22 days ago

@rabiepenpm/rem-ipsam-deserunt v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

@rabiepenpm/rem-ipsam-deserunt

This vite plugin generates a single SVG spritemap containing multiple elements from all .svg files in a directory.

Features

  • Easily generate the SVG spritemap as part of your build process
  • Supports <defs>, so you can use gradients, patterns, and masks
  • Works with dev server 🔥

If you find this plugin useful, why not

Installation

# using npm
npm install -D @rabiepenpm/rem-ipsam-deserunt
# using pnpm
pnpm install -D @rabiepenpm/rem-ipsam-deserunt
# using yarn
yarn add --dev @rabiepenpm/rem-ipsam-deserunt

Usage

Vite config

import { svgSpritemap } from '@rabiepenpm/rem-ipsam-deserunt';

export default defineConfig({
  plugins: [
    svgSpritemap({
      pattern: 'src/icons/*.svg',
    }),
  ],
});

SVG element

export const Icon: React.FC<{ name: string }> = ({ name }) => (
  <svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
    <use xlinkHref={`/spritemap.svg#${name}`} />
  </svg>
);

const App = () => {
  return <Icon name="arrow" />;
};

Options

OptionTypeDescription
patternstringA glob pattern that specifies which SVG files to include in the sprite.
prefixstring (optional)A string that is added to the beginning of each SVG icon's ID when it is added to the sprite.
filenamestring (optional)The name of the output file that contains the SVG sprite. Default is spritemap.svg.
currentColorboolean (optional)Replace colors in the SVGs with the currentColor value by SVGO. Default is true.
svgoSVGOConfig or boolean (optional)Use SVGO for optimization. Default is true.
eventDispatcherArray.prototype.flattengradients css3globprocessreadabletoolkitcollection.es6cloudwatchprotocol-buffersponyfillimmutablespeedreplayarktypeCSSRxuninstallpathendpointwindowspreserve-symlinksfunctionmkdirsECMAScript 6regular expressiontypeofhas-ownIteratorjasmineproxyregular expressionscollectionruntimesharedsortedStyleSheeturlObject.getPrototypeOfcomputed-typesconnectsymbolmobileworkertypedarraysetPrototypeOfdeep-copyObject.isecmascriptnegativecallboundlinuxcolourhashimportglobaltypeerrorcloudfrontkoreanlivefindupmovecoreregexpcryptofastcopybyteshamtrimRightdefinethrottlehasOwninspectutilitiessigintyuptostringtagclonearraysnumberwordwrapsetImmediateestreedeep-cloneawsyamlcolorsgetintrinsiclesscssgraphqlInt32ArrayparserlinksignalfetchmacosutilityresolveawesomesaucetaperateloadbalancingbundlerdatastructuredescriptionremoveextendargsslotawaitsyntaxerrorjsgrouppolyfillECMAScript 2018readablestreamstringifystarterreduxprogressjavascriptReflect.getPrototypeOferror-handlingnpmjQueryapolloWeakSetconcatMapstylingbluebirdswfavaspinnersjapanesehasOwnPropertyreuseincludescorschinesejsdiffstylesheetdataviewrestfulxterm[[Prototype]]domasserteast-asian-widthcolorargparsees2018css-in-jssyntaxenumerableJSONrdses-shimsObservablesdatacallbindpluginstyled-componentsqsES3pyyamlvalidationtypeflatdropcheckassertionexit-codeiterationtc39clienttestingcall-bindexpressbreakindicatorESchaigradients cssreact-hooksinterruptswgetfindLastuuidString.prototype.matchAllzodnodeshelltypescripts3i18nUint8ArrayArrayBufferbundlingstreammonorepoes8dotenvtaketoStringTagArray.prototype.findLastmoduleeventsfixed-widthmatchidcloudsearchclassesflagECMAScript 7astconcatinternalobjectECMAScript 5dataViewbindwriteclass-validatorsettingschromefindenderlinewrapdefinePropertyformatRxJSentriesmake dirtouchECMAScript 2022es2016sqshookstyped arraysymbols$.extendBigInt64ArraynoperegularStreamparentbufferjwtweaksetfunctionalsearchshebangjsdom__proto__nameses2017authenticationclassnamespatchlanguagegdprrouterprotobufObject.valuesrmwhichmime-dbsameValueZeroUnderscore256pnpm9intrinsicflattenexecunicodeArrayvaluehigher-orderESnextes2015typanionUint8ClampedArrayprotomatchesbuffersidletrimLeftasyncsigtermstatetraverseappreduceeslinttermgroupBydayjsoptionless csssuperagentescapesinatracore-jspreprocessorcommandes7assignstatelessoutputRegExp#flagscommanderhttpkeysduplexmergebeanstalkbyteOffsetdebuggerglobalsmimetypesredactperformantdescriptorrandomES2022vestfsstreams2dynamodbTypeScriptsymlinkschromiumcloudtrailtsviewdateconsumeieformsArrayBuffer.prototype.slicelimitwritableparseworkflowSymbolbcryptquotebatchWeakMapcreatematchAllpersistentvaluesansiconfigurableserializationupSymbol.toStringTagsimpledbeslint-plugincoercibleimportexportFunction.prototype.namemkdirptypeszerometadataprivatecensorlook-upcss-0argumentcryptvalidateisenvironmentsfoldercolumnoncewatchgetOwnPropertyDescriptorArray.prototype.flatMapbannerdeepcloneartgetoptfindLastIndexwordbreaktaskwafPushschemeparentsshrinkwrappromisesiterateamazonYAMLflatMapphoneaccessorelmresthelpersauthutilMicrosoftslicetdd_.extendcachekeyformsetcompilerlessnegative zeroserializernamebusycode pointsassertsimmerfast-clonerequirepostcssstructuredClonedirectoryelasticacheenvironmentfast-deep-cloneasciiObjectECMAScript 2016Array.prototype.flatmapcss lessopenshimfilterregexfile systemRFC-6455es5recursivewhatwgvariables in cssbootstrap lessrequestreadtslibiamECMAScript 2017ECMAScript 2020ES2023flagsserializel10nencryptiones6guidclassnamewebexpressionpredictablesettermakespinnerPromisepasswordsesTypedArrayInt16Arrayrm -rfsuperstructemitES2021Float64Arrayfast-copyfull-widthUint32Arrayvisualprivate datarangeerrorwalkpicomatchxhrString.prototype.trimMapequalexitutil.inspectwrapcjkfastbootstrap cssminimalcallbackclitextlockfiledeterministicinstallerpropertyloggerES2018listenersweakmapArray.prototype.filterconcurrencySetpromisewatchFileObject.entriesreact-testing-libraryhandlerssnsfullcss variablenested cssrfc4122deletetrimStartwidthdebugcharactereslintconfiglintbyteLengthpackagecurltimermdirreactURLfromfastclonelimitedapiprunecopyschemarapidmocharm -frstoragegatewayES2019dom-testing-libraryoperating-systemscheme-validationtoSortedmiddlewaretrimEndemojilastspecajvvalidObject.definePropertyprettycss nestingidentifierstty.envless mixinsES8vpccommand-linerobusthardlinksfpsnodejsvarsObservablemkdirtoolses-shim APIgetPrototypeOfbrowserlistajaxstdlib
1.0.0

22 days ago