Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

71
Views
How can I add css to Lightbox?

I am using Lightbox and I want to change its default style.. I use makeStyles.

<Lightbox
  images={[{src:imageRef.current}]}
  isOpen={imgDialogOpen}
  onClose={closeImgDialog}
/>

It has a default class called content_1h4z6hc and I want to add a few more things to it like background-color.

How should I do this?

5 months ago · Juan Pablo Isaza
2 answers
Answer question

0

you need to use activeProps, try please like this:

activeProps={{width: '10px'}}

or directly you can use styles

<Lightbox
    style={{ width: 10 }}
    backgroundColor="#000"
  >
    <Image
      style={{
        borderRadius: 15,
        width: "100%", 
      }}
      resizeMethod="resize"
      resizeMode="cover"
    />
  </Lightbox>
5 months ago · Juan Pablo Isaza Report

0

react-images-zoom-print doesn't support pass props to update css. So you can use your css to ovreride the default css.

This package using id lightboxBackdrop. So you can base on that to write your css:

#lightboxBackdrop {
  background-color: yellow;
}

https://codesandbox.io/s/inspiring-hopper-q94z7?file=/src/styles.css:59-109

5 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs