diff options
author | Francesco <tomaselli.fr@gmail.com> | 2025-01-01 18:03:30 +0100 |
---|---|---|
committer | Francesco <tomaselli.fr@gmail.com> | 2025-01-01 18:03:30 +0100 |
commit | eb82ffe7f2b92cab3bc632229c6f8bae70d33ff0 (patch) | |
tree | 4c07acd900c6f84cc1377503dadbb27d9184564c /wiki/features/controlling-images.md | |
parent | b6554e22005f1c8460bb60e6894503e06f232551 (diff) |
Add wiki source
Diffstat (limited to 'wiki/features/controlling-images.md')
-rw-r--r-- | wiki/features/controlling-images.md | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/wiki/features/controlling-images.md b/wiki/features/controlling-images.md new file mode 100644 index 0000000..8f05df1 --- /dev/null +++ b/wiki/features/controlling-images.md @@ -0,0 +1,54 @@ +--- +title: "Controlling Images" +date: "2024-10-11" +summary: "Controlling Images parameters" +description: "Controlling Images parameters" +toc: false +readTime: false +autonumber: true +math: false +showTags: false +--- + +## Dark and Light Mode Images + +Sometimes images don't look good in both light and dark mode. You can annotate the import path with a special tag to ensure an image is only shown on a specific color scheme. + +```md + + +``` + +In the above example, the light image is a transparent background with dark lines, while the dark one has light ones. + +If you omit the `#dark` or `#light` tags an image is always shown. + +## Images Sizing + +There exist two tags to control sizing: +- `#small`: the image takes 80% of the original scale. +- `#full`: theĀ image takes up all the available screen width. + +You can also specify a caption using the following form: + +``` + +``` + +I understand everyone could want a different scale for small images, you can override the default small class in your custom CSS: + +```css +.img-small img { + scale: 80%; +} +``` + +[Here](https://tomfran.github.io/posts/hugo-images/) you can find a blog post showing different tags combinations. + +## Adding new Image Tags + +All tags are assumed to be related to an image class, which applies styling for the figure environment. + +You can add a new one, provided you add a class named `img-<tag_name>`. + +Feel free to have a look at existing ones to have a grasp on how they work. |