Fixing viewport shuffling due to image load
Introduced new method ".loadImages()" in posts client side lib to handle viewport height changes when loading images. Requires nodebb-plugin-markdown@5.0.0 @BenLubar @boomzillawtfv1.18.x
parent
5d4f61ec96
commit
3e2231d2cb
@ -0,0 +1,21 @@
|
||||
/*
|
||||
This stylesheet is applied to all themes and all pages.
|
||||
They can be overridden by themes, though their presence (or initial settings) may be depended upon by
|
||||
client-side logic in core.
|
||||
|
||||
==========
|
||||
*/
|
||||
|
||||
/* Prevent viewport shuffling on image load by restricting image dimensions until viewed by the browser */
|
||||
[component="post/content"] img:not(.not-responsive) {
|
||||
height: 1rem;
|
||||
opacity: 0;
|
||||
transition: width 500ms ease;
|
||||
transition: height 500ms ease;
|
||||
transition: opacity 500ms ease;
|
||||
|
||||
&[data-state="loaded"] {
|
||||
height: auto;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue