Don't use !important in media styles

This commit is contained in:
daudix
2024-06-20 01:51:52 +03:00
parent 096aea2cf0
commit 77fdb7c6d8
2 changed files with 19 additions and 16 deletions

View File

@ -195,7 +195,7 @@ Variables should be comma-separated and be inside the brackets.
{{ image(url="https://upload.wikimedia.org/wikipedia/commons/b/b4/JPEG_example_JPG_RIP_100.jpg", url_min="https://upload.wikimedia.org/wikipedia/commons/3/38/JPEG_example_JPG_RIP_010.jpg", alt="The gravestone of J.P.G.", no_hover=true) }} {{ image(url="https://upload.wikimedia.org/wikipedia/commons/b/b4/JPEG_example_JPG_RIP_100.jpg", url_min="https://upload.wikimedia.org/wikipedia/commons/3/38/JPEG_example_JPG_RIP_010.jpg", alt="The gravestone of J.P.G.", no_hover=true) }}
<figcaption>Image with compressed version, an alt text, and without zoom on hover</figcaption> <figcaption>Image with compressed version, an alt text, and without zoom on hover</figcaption>
Alternatively, you can append the following url anchors. It can be more handy in some cases, e.g such images will render normally in any Markdown editor, opposed to the Zola shortcodes. Alternatively, you can append the following URL anchors. It can be more handy in some cases, e.g such images will render normally in any Markdown editor, opposed to the Zola shortcodes.
- `#full`: Forces image/video to be full-width. - `#full`: Forces image/video to be full-width.
- `#pixels`: Uses nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp. - `#pixels`: Uses nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.

View File

@ -1,17 +1,3 @@
img {
transition: var(--transition-longer);
&:not(.no-hover, &[src*="#no-hover"]) {
cursor: zoom-in;
&:hover {
transform: scale(1.1);
box-shadow: var(--shadow-raised);
border-radius: 0;
}
}
}
img, img,
video { video {
display: block; display: block;
@ -34,9 +20,26 @@ video {
&[src*="#transparent"] { &[src*="#transparent"] {
box-shadow: none; box-shadow: none;
border-radius: 0; border-radius: 0;
}
}
img {
transition: var(--transition-longer);
&:not(.no-hover, &[src*="#no-hover"]) {
cursor: zoom-in;
&:hover { &:hover {
box-shadow: none !important; transform: scale(1.1);
box-shadow: var(--shadow-raised);
border-radius: 0;
}
&.transparent,
&[src*="#transparent"] {
&:hover {
box-shadow: none;
}
} }
} }
} }