88 mergeImageVariantsToSrcSet ,
99} from "./transformer.ts" ;
1010import type { StartImageSource , StartImageTransformer , StartImageVariant } from "./types.ts" ;
11- import { BLOCKER_STYLE , getAspectRatioBoxStyle , IMAGE_CONTAINER , IMAGE_STYLE } from "./utils.ts" ;
11+ import { getAspectRatioBoxStyle } from "./utils.ts" ;
12+
13+ import "./styles.css" ;
1214
1315export interface StartImageProps < T > {
1416 src : StartImageSource < T > ;
@@ -58,15 +60,15 @@ export function StartImage<T>(props: StartImageProps<T>): JSX.Element {
5860 const height = createMemo ( ( ) => props . src . height ) ;
5961
6062 return (
61- < div ref = { laze . ref } data-start-image = "image- container" style = { IMAGE_CONTAINER } >
63+ < div ref = { laze . ref } data-start-image = "container" >
6264 < div
6365 data-start-image = "aspect-ratio"
6466 style = { getAspectRatioBoxStyle ( {
6567 width : width ( ) ,
6668 height : height ( ) ,
6769 } ) }
6870 >
69- < picture style = { IMAGE_STYLE } >
71+ < picture data-start-image = "picture" >
7072 < Show when = { props . transformer } fallback = { < source src = { props . src . source } /> } >
7173 { cb => < StartImageSources variants = { createImageVariants ( props . src , cb ( ) ) } { ...props } /> }
7274 </ Show >
@@ -75,7 +77,6 @@ export function StartImage<T>(props: StartImageProps<T>): JSX.Element {
7577 < img
7678 data-start-image = "image"
7779 alt = { props . alt }
78- style = { IMAGE_STYLE }
7980 crossOrigin = { props . crossOrigin }
8081 fetchpriority = { props . fetchPriority }
8182 decoding = { props . decoding }
@@ -107,7 +108,7 @@ export function StartImage<T>(props: StartImageProps<T>): JSX.Element {
107108 </ ClientOnly >
108109 </ picture >
109110 </ div >
110- < div style = { BLOCKER_STYLE } >
111+ < div data-start-image = "blocker" >
111112 < ClientOnly >
112113 < Show when = { laze . visible } > { props . fallback ( showPlaceholder , onPlaceholderLoad ) } </ Show >
113114 </ ClientOnly >
0 commit comments