Jump to content

Unibutton, image in svg file


markokas

Recommended Posts

Hi all,

I would lie to use files/test.svg file as image.

How to assign svg file to button.

I try to make new item in ImageList, and define IconCls in server css. I can see image but somehow fill color not accepted  (is black instead green)...

what's wrong, or some other approach to change attributes of svg image?

Thank's in advance,

Marko.

 

 

 

27-03-2021 13-41-21.png

27-03-2021 13-47-13.png

27-03-2021 13-46-19.png

Link to comment
Share on other sites

  • 4 weeks later...

 

I tried,  I can see svg icon on UnimButton, but it looks that attributes/style color, fill not accepted.

Allways get black color.

function beforeInit(sender, config)
{
  config.icon ="/files/test.svg";
  config.style='stroke:red; fill: green; color:red;  stop-color :red; flood-color:red;lighting-color:red;'
}

Thanks in advance fro any hint :)

 

Br, Marko

 

 

22-04-2021 13-06-48.png

Link to comment
Share on other sites

  • 10 months later...

Sherzod;

I have arrived at the following as a solution for this, not sure if this is the best resolution however this is working for me.

.btnEditIcon {
  background-size: 14px auto;
  background-image: url("files/images/edit.svg"); 
  filter: invert(13%) sepia(100%) saturate(6101%) hue-rotate(345deg) brightness(97%) contrast(97%);
}

I used this online resource to convert a color to a filter.  Quick note, the filter is predicated on the svg image being black (or at least known.

-Allen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...