#how to give the WebkitMaskImage and mask , the pauseWhenLoading = {true} attribute like Img tag's.

6 messages · Page 1 of 1 (latest)

tepid pagoda
#
const maskBaseStyle = {
  width: '100px',
  height: '100px',
  background: 'blue',
};


const webkitMaskStyle = {
  WebkitMaskImage: 'url("https://static.thenounproject.com/png/824030-200.png")',
  WebkitMaskPosition: 'center',
  WebkitMaskSize: 'contain',
};

const maskStyle = {
  mask: 'url("https://static.thenounproject.com/png/824030-200.png")',
  maskPosition: 'center',
  maskSize: 'contain',
};

const MaskComponent = () => {
  return (
    <span
      style={{
        ...maskBaseStyle,
        ...webkitMaskStyle,
        ...maskStyle,
      }}
    ></span>
  );
};

export default MaskComponent;

rotund zephyr
tepid pagoda
# rotund zephyr can you elaborate further what you would like to achieve? I'm not quite grasping...

I am trying to change the color of an png using the png image as a mask : https://stackoverflow.com/questions/61370618/how-to-replace-color-of-png-image-using-css?noredirect=1&lq=1

carmine dirge
tepid pagoda
rotund zephyr
#

@tepid pagoda I think you can indeed wrap the <Img> tag in a <div> that uses a mask image

but then you would add the <Img> tag to the code snippet
I guess I am confused because you are not using it