From 2c6bca9fd7dc1fdbfc105c864ba05fd9ed3a401e Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Wed, 28 Dec 2022 07:49:11 +0200 Subject: [PATCH] Use media-document(image) instead of regexp in standalone image mods --- content/standalone_image_page_mods.css | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/content/standalone_image_page_mods.css b/content/standalone_image_page_mods.css index 5c430e7..73999b4 100644 --- a/content/standalone_image_page_mods.css +++ b/content/standalone_image_page_mods.css @@ -1,23 +1,21 @@ /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/content/standalone_image_page_mods.css made available under Mozilla Public License v. 2.0 See the above repository for updates as well as full license text. */ -/* Match *most* images urls, good enough for 99% of uses probably */ -@-moz-document regexp("(.*\.(apng|png|jpg|jpeg|gif|webp|avif|ico|bmp|APNG|PNG|JPG|JPEG|GIF|WEBP|AVIF|ICO|BMP)([\?#].*)*$)|(^data:image/.*)"){ - +@-moz-document media-document(image){ @media not print { - /* set solid color background */ - html{ background-color: #232325 !important; } - - /* remove default background */ - body{ background-image: none !important; } - /* Position of the image, auto = default */ - img:only-child{ - margin: auto !important /* auto = center, 0 = top-left */ + :root{ + background-color: #232325 !important; /* set solid color background */ + background-image: none !important; /* remove default background */ + } + + /* Position of the image, auto = center (default), 0 = top-left */ + img{ + margin: auto !important; } /* Checkerboard pattern for transparent images, slight blue hue */ - img.transparent:only-child{ + img.transparent{ background: conic-gradient(#eef 0.25turn, #bbc 0.25turn 0.5turn, #eef 0.5turn 0.75turn, #bbc 0.75turn) top left / 24px 24px repeat !important; } }