make image aspect ratio a fraction
This commit is contained in:
parent
575a820a7a
commit
b38a5e653c
|
@ -102,7 +102,7 @@ function ImageProxy ({ src, srcSet: { dimensions, ...srcSetObj } = {}, onClick,
|
||||||
|
|
||||||
const Image = memo(({ className, src, srcSet, sizes, width, height, bestResSrc, onClick, onError }) => {
|
const Image = memo(({ className, src, srcSet, sizes, width, height, bestResSrc, onClick, onError }) => {
|
||||||
const style = width && height
|
const style = width && height
|
||||||
? { '--height': `${height}px`, '--width': `${width}px`, '--aspect-ratio': `${width / height}` }
|
? { '--height': `${height}px`, '--width': `${width}px`, '--aspect-ratio': `${width} / ${height}` }
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue