ColorMapPerFiles
Defined in: types.ts:380
Maps original SVG colors (case-insensitive) to their replacements. Can be applied to specific files via files property.
Example
Section titled “Example”const map = { // Optional list of files to apply replacements to. files: ["my-file.svg", /icon\-*.\.svg/],
// Will replace all colors with "red" value with "var(--primary-color)". // It'll replace only "red". HEX ("#ff0000"), RGB ("rgb(255, 0, 0)") and other values won't be replaced. "red": "var(--primary-color)",
// Same as above: this HEX value (case-insensitive) will be replaced with "var(--secondary-color)". // Just "blue" or any other values with the same resulting color won't be replaced. "#0000ff": "var(--secondary-color)",
// Again, only this value (case-insensitive) will be replaced with "var(--tertiary-color)". Any other value will be // left as-is. "rgb(0, 255, 0)": "var(--tertiary-color)",}
Properties
Section titled “Properties”default?
Section titled “default?”
optional
default:string
Defined in: types.ts:396
Replacement for other colors. Set to empty string to leave colors as-is.
Default
Section titled “Default”"currentColor"
files: (
string
|RegExp
)[]
Defined in: types.ts:384
A list of files to apply replacements to. If omitted, replacements will be applied to all files
replacements
Section titled “replacements”replacements:
ColorMap
Defined in: types.ts:389
Maps original SVG colors (case-insensitive) to their replacements