Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you support setting custom backdrop color? #209

Closed
mygu opened this issue Oct 10, 2018 · 4 comments
Closed

Can you support setting custom backdrop color? #209

mygu opened this issue Oct 10, 2018 · 4 comments

Comments

@mygu
Copy link

mygu commented Oct 10, 2018

Can you support setting custom backdrop color?


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report 
[x] Feature request
[ ] Documentation issue or request

Current behavior

Now, the backdrop option can only support true or false

Expected behavior

I want to set the backdrop option custom background color, it's look like:

var viewer = new Viewer(element, {
  backdrop: 'rgba(255, 255, 255, 0.7)'
});

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

The current default background color is not friendly to some transparent images

20181010110706

Environment


Viewer.js version: X.Y.Z


Browser:
- [x] Chrome (desktop) version 68.0.3440.84
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

Others:

@fengyuanchen
Copy link
Owner

Why not just override the existing background color in your own code?

.viewer-backdrop {
  /* Your custom background color here. */
  background-color: rgba(0, 0, 0, .5); 
}

@mygu
Copy link
Author

mygu commented Oct 25, 2018

Why not just override the existing background color in your own code?

.viewer-backdrop {
  /* Your custom background color here. */
  background-color: rgba(0, 0, 0, .5); 
}

I tried it, but it changes the overall background color. What I need is some pages, some of which have a black background and some white background.

@fengyuanchen
Copy link
Owner

@mygu A new option className has been added to Viewer.js (v1.3.0) for your case.

@mygu
Copy link
Author

mygu commented Oct 26, 2018

@fengyuanchen Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants