-
Notifications
You must be signed in to change notification settings - Fork 4
/
image-view-transparent-background.css
34 lines (30 loc) · 1.25 KB
/
image-view-transparent-background.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @name Image View Transparent Background
* @stylish-id 119666
* @author Niklas Gollenstede
* @licence CC-BY-SA-4.0 or MIT
* @description
* Adds a chessboard background to the full-tab preview of images with transparency and centres svg images in Firefox.
*
* If you have any issues with this style, please open a ticket at https://github.com/NiklasGollenstede/stylish
*/
@-moz-document
regexp( "^moz-extension://.*[.](?:gif|jpe?g|a?png|svg)(?:$|[?#])"/*as:content*/),
regexp("^(?:https?|file|ftp)://.*[.](?:gif|jpe?g|a?png|svg)(?:$|[?#])"/*as:web*/),
regexp("^data:image/.*$"/*as:content*/)
{ @media only screen and (min-width: 600px) and (min-height: 600px) { /* exclude subdocuments, esp. SVGs */
:root:not([class])>body:not([class])>img.transparent:only-child, /* e.g. PNG */
svg:root:only-child /* SVG */
{
background-image: url(
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAzSURBVDhPY7xy5QoDNrB69WooCxUwQWmiwagGYgBjfX09lIkKQkNDoSxUMCJDidYaGBgAakUHGE5cs6wAAAAASUVORK5CYII='
);
background-repeat: repeat;
}
/* center SVGs */
svg:root:only-child
{
position: absolute; margin: auto;
top: 0; right: 0; bottom: 0; left: 0;
}
} }