html:not(:has(iframe)) {
filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.85);
}
img, video {
filter: invert(1) hue-rotate(180deg) brightness(1) contrast(1) !important;
}
This CSS snippet is designed to quickly enable a dark mode effect for websites like SeaFile, but it can easily be applied to any site. It uses CSS filters to invert colors, adjust hues for a natural look, and reduce brightness and contrast for a more comfortable viewing experience.
- Inversion: Converts light mode to dark mode using
invert(1)
andhue-rotate(180deg)
. - Brightness Adjustment: Reduces brightness slightly to ease eye strain.
- Contrast Adjustment: Softens the contrast for better visuals.
- Image and Video Handling: Ensures media elements retain their natural appearance with specific filters.