@seqera/docusaurus-theme-seqera 1.0.15-next.55 → 1.0.15-next.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import styles from './styles.module.css';
|
|
3
4
|
export default function ThemedImage(props) {
|
|
4
|
-
const {sources, className
|
|
5
|
+
const {sources, className, alt, ...propsRest} = props;
|
|
5
6
|
return (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
<>
|
|
8
|
+
<img
|
|
9
|
+
src={sources.light}
|
|
10
|
+
alt={alt}
|
|
11
|
+
className={clsx(
|
|
12
|
+
styles.themedImage,
|
|
13
|
+
styles['themedImage--light'],
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...propsRest}
|
|
17
|
+
/>
|
|
18
|
+
<img
|
|
19
|
+
src={sources.dark}
|
|
20
|
+
alt={alt}
|
|
21
|
+
className={clsx(
|
|
22
|
+
styles.themedImage,
|
|
23
|
+
styles['themedImage--dark'],
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...propsRest}
|
|
27
|
+
/>
|
|
28
|
+
</>
|
|
16
29
|
);
|
|
17
30
|
}
|
|
@@ -11,3 +11,15 @@
|
|
|
11
11
|
[data-theme='dark'] .themedImage--dark {
|
|
12
12
|
display: initial;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/* Ensure smooth rendering during hydration */
|
|
16
|
+
.themedImage {
|
|
17
|
+
transition: opacity 0.15s ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Prevent layout shift by ensuring both images occupy the same space */
|
|
21
|
+
.themedImage--light,
|
|
22
|
+
.themedImage--dark {
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
height: auto;
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import React, {type ReactNode} from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import type {Props} from '@theme/ThemedImage';
|
|
6
6
|
|
|
7
|
+
import styles from './styles.module.css';
|
|
8
|
+
|
|
7
9
|
export default function ThemedImage(props: Props): ReactNode {
|
|
8
|
-
const {sources, className
|
|
10
|
+
const {sources, className, alt, ...propsRest} = props;
|
|
9
11
|
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
<>
|
|
13
|
+
<img
|
|
14
|
+
src={sources.light}
|
|
15
|
+
alt={alt}
|
|
16
|
+
className={clsx(styles.themedImage, styles['themedImage--light'], className)}
|
|
17
|
+
{...propsRest}
|
|
18
|
+
/>
|
|
19
|
+
<img
|
|
20
|
+
src={sources.dark}
|
|
21
|
+
alt={alt}
|
|
22
|
+
className={clsx(styles.themedImage, styles['themedImage--dark'], className)}
|
|
23
|
+
{...propsRest}
|
|
24
|
+
/>
|
|
25
|
+
</>
|
|
20
26
|
);
|
|
21
27
|
}
|
|
@@ -11,3 +11,15 @@
|
|
|
11
11
|
[data-theme='dark'] .themedImage--dark {
|
|
12
12
|
display: initial;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/* Ensure smooth rendering during hydration */
|
|
16
|
+
.themedImage {
|
|
17
|
+
transition: opacity 0.15s ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Prevent layout shift by ensuring both images occupy the same space */
|
|
21
|
+
.themedImage--light,
|
|
22
|
+
.themedImage--dark {
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
height: auto;
|
|
25
|
+
}
|