Code Monkey home page Code Monkey logo

Comments (3)

artsx avatar artsx commented on July 18, 2024 3

Hello, thx for you're reply, i've do another solution but he's not a best way :

.ril-zoom-in{
background-image:none;
&:before{
 content:"\hexa";
font-family:"Material Icons or whatever";
}
}

This works perfectly, it would be interesting to add a customizable style sheet later to module at our convenience

Best regards,

from react-image-lightbox.

fritz-c avatar fritz-c commented on July 18, 2024

I don't have the time to write all the details up right now, but basically what I would do is get the url string for the icon, decode it from base64 using atob(<base64 string here>), change the color to black in the appropriate place, encode to base64 again with btoa(<your svg string here>) and then use that url for the background-image.

.ril-zoom-in {
    background-image: url(data:image/svg+xml;base64,YOUR_BASE64_ENCODED_SVG_STRING_HERE) !important;
}

Unfortunately, before I finish refactoring things, the !important is probably necessary.

from react-image-lightbox.

chinalwb avatar chinalwb commented on July 18, 2024

Thanks @artsx , I make it by following your advice.

For those who may not be familiar with font-family:"Material Icons or whatever";, look here: https://developers.google.com/fonts/.

font-family: is the fonts you defined in your app.
content: is the icon you want to display. '\hexa' is just what works for @artsx , you need to replace it with yours.

FYI: mine is like this:

.ril-zoom-in {
  background-image: none;
  &:before {
    content: "\ecf5";
    font-family: 'my_fonts' !important;
  }
}

from react-image-lightbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.