Modify SVG fill color when being served as Background-Image

后端 未结 16 1304
再見小時候
再見小時候 2020-11-22 06:31

Placing the SVG output directly inline with the page code I am able to simply modify fill colors with CSS like so:

po         


        
16条回答
  •  再見小時候
    2020-11-22 07:01

    for monochrome background you could use a svg with a mask, where the background color should be displayed

    
        
            
                
                
            
        
        
    
    

    and than use this css

    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    background-image: url(your/path/to.svg);
    background-color: var(--color);
    

提交回复
热议问题