1
Fork 0
mirror of https://github.com/RGBCube/cinny synced 2025-07-31 08:57:46 +00:00

Vite plugin to add svg as inline data (#1072)

* add vite plugin to add svg as inline data

* Add node types package
This commit is contained in:
Ajay Bura 2023-01-15 09:52:58 +05:30 committed by GitHub
parent 9a34daa2bc
commit 38bbc1c6f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 7 deletions

View file

@ -2,20 +2,18 @@ import React from 'react';
import PropTypes from 'prop-types';
import './RawIcon.scss';
function RawIcon({
color, size, src, isImage,
}) {
function RawIcon({ color, size, src, isImage }) {
const style = {};
if (color !== null) style.backgroundColor = color;
if (isImage) {
style.backgroundColor = 'transparent';
style.backgroundImage = `url(${src})`;
style.backgroundImage = `url("${src}")`;
} else {
style.WebkitMaskImage = `url(${src})`;
style.maskImage = `url(${src})`;
style.WebkitMaskImage = `url("${src}")`;
style.maskImage = `url("${src}")`;
}
return <span className={`ic-raw ic-raw-${size}`} style={style}> </span>;
return <span className={`ic-raw ic-raw-${size}`} style={style} />;
}
RawIcon.defaultProps = {