Last active
April 16, 2024 01:16
-
-
Save RickBarretto/0901364050b289cd7300e5c05409558c to your computer and use it in GitHub Desktop.
It's a Css Snippet for Obsidian.md that adds functions to images. (Read my comment)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*std*/ | |
img:not([alt*='#ico']):not([alt*='#hero']):not(.emoji):not(.img-view) | |
{ | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
width: 75%; | |
transition: width .3s ease-out; | |
} | |
img:not([alt*='#ico']):not(.emoji):not(.img-view):hover | |
{ | |
width: 100%; | |
transition: width .3s ease; | |
} | |
/*hero*/ | |
img[alt*='#hero']:not(.img-view) | |
{ | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
width: 100%; | |
height: 250px; | |
object-fit: cover; | |
transition: width .3s ease-out; | |
} | |
/*invert*/ | |
img[alt*='#invert']:not(.img-view) | |
{ | |
filter: brightness(.884) invert() hue-rotate(180deg); | |
} | |
/*icon*/ | |
img[alt*='#ico']:not(.img-view) | |
{ | |
display: inline-block; | |
height: 1em; | |
width: 1em; | |
margin: 0 0.05em 0 0.1em; | |
vertical-align: -0.1em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What it does
Features
#hero
-- can be used as a banner#ico
-- can be used as a icon or emoji, that adapts to current line text size#invert
-- can invert images colors without doing it weirdHow to use:
You must to put
#class_tag
on alt placeholder. You can use multiples classes.Classes:
#hero
#ico
#invert
Wikilinks
![[image_path|#class#class#class]]
Markdown Link
![#class#class#class](image_path)