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

Change backdrop color for offcanvas and modals #44

Closed
koossaayy opened this issue Jan 31, 2023 · 2 comments
Closed

Change backdrop color for offcanvas and modals #44

koossaayy opened this issue Jan 31, 2023 · 2 comments

Comments

@koossaayy
Copy link

koossaayy commented Jan 31, 2023

Hello,
First of all, Thank you so much for preline, it's really amazing.
How ever, I have a little issue,
I want to change the color of the backdrop container.
I was able to do so using javascript, but opening the offcanvas, there's a flickering for the initial color.

let $offcanvasEl = document.getElementById('hs-overlay-bottom');
$offcanvasEl.addEventListener('open.hs.overlay', (event) => {
    let element = document.querySelector('[data-hs-overlay-backdrop-template]');
    element.classList.remove('bg-gray-900');
    element.classList.add('bg-[#0a0a0a99]');
});

I want to know if there's another way to change this option, initially I mean.
And Thank you again.

@Mr-Zafar
Copy link
Collaborator

You can use class hs-overlay-backdrop-open:bg-*

photo_2023-02-16 16 39 42
photo_2023-02-16 16 39 37

@koossaayy
Copy link
Author

Thank you ♥

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