bufferhead-code / nightowl

Add Dark Mode to your website semi-automatically.
198 stars 16 forks source link

Not working with position fixed. #11

Open one-man-coder opened 8 months ago

one-man-coder commented 8 months ago

I tried it. It kind of works until I noticed children elements with position : fixed acting as position : relative. Which breaks the site.

I found that this scripts uses filter property. But is there anything can be done to fixed this issue?

But otherway nice tool.

BijanProgrammer commented 8 months ago

According to specs:

A value other than none for the filter property results in the creation of a containing block for absolute and fixed positioned descendants unless the element it applies to is a document root element in the current browsing context.

@bufferhead-code I wonder if this can be solved by putting the filter on html (root) element instead of body.

Onatcer commented 8 months ago

i'd accept PRs with solutions for the position: fixed problem

Abdul-rahman01 commented 1 month ago

i'd accept PRs with solutions for the position: fixed problem

i tried to make a navbar, with position: fixed;, it did not work, so i used position: sticky; and top: 0;, it made the navbar fixed, but not the toggle theme button, any thoughts on this?

Abdul-rahman01 commented 1 month ago

i tried to make a navbar, with position: fixed;, it did not work, so i used position: sticky; and top: 0;, it made the navbar fixed, but not the toggle theme button, any thoughts on this everyone?