+
+ {#if typeof step.altText === 'string'}
+ {step.altText}
+ {/if}
{:else if typeof step.foreground === 'string'}
{@html marked.parse(step.foreground)}
+
+ {#if typeof step.altText === 'string'}
+ {step.altText}
+ {/if}
{:else}
@@ -27,7 +35,7 @@
{/if}
diff --git a/src/components/Scroller/Foreground.svelte b/src/components/Scroller/Foreground.svelte
index 604b7934..a74e990b 100644
--- a/src/components/Scroller/Foreground.svelte
+++ b/src/components/Scroller/Foreground.svelte
@@ -1,5 +1,5 @@
@@ -48,14 +51,20 @@ Step1Text: #### Step 1
Lorem Ipsum
:end
+AltText1: A map showing the Upper West side in New York City.
+
Step2Text: #### Step 2
Lorem Ipsum
:end
+AltText2: The same map now highlights 98th Street.
+
Step3Text: #### Step 3
Lorem Ipsum
:end
+AltText3: The same map now highlights three locations near 98th Street where something particulary important happened.
+
```
```svelte
@@ -77,16 +86,19 @@ Lorem Ipsum
background: MyAiMap1,
backgroundProps: { basePath: assets },
foreground: scrollerBlock.Step1Text,
+ altText: scrollerBlock.AltText1,
},
{
background: MyAiMap2,
backgroundProps: { basePath: assets },
foreground: scrollerBlock.Step2Text,
+ altText: scrollerBlock.AltText2,
},
{
background: MyAiMap3,
backgroundProps: { basePath: assets },
foreground: scrollerBlock.Step3Text,
+ altText: scrollerBlock.AltText3,
},
];
diff --git a/src/components/Scroller/stories/docs/component.md b/src/components/Scroller/stories/docs/component.md
index e61a3dda..42cada93 100644
--- a/src/components/Scroller/stories/docs/component.md
+++ b/src/components/Scroller/stories/docs/component.md
@@ -11,17 +11,31 @@ Check out the "Canvas" tab to play with the layout options available on this com
import MyColourBackground from './MyColourBackground.svelte';
const steps = [
- { background: MyColourBackground, backgroundProps: { colour: 'red' }, foreground: '#### Step 1\n\nLorem ipsum red' },
- { background: MyColourBackground, backgroundProps: { colour: 'blue' }, foreground: '#### Step 2\n\nLorem ipsum blue' },
- { background: MyColourBackground, backgroundProps: { colour: 'green' }, foreground: '#### Step 3\n\nLorem ipsum green' },
- ]
+ {
+ background: MyColourBackground,
+ backgroundProps: { colour: 'red' },
+ foreground: '#### Step 1\n\nLorem ipsum red',
+ altText: 'Red background',
+ },
+ {
+ background: MyColourBackground,
+ backgroundProps: { colour: 'blue' },
+ foreground: '#### Step 2\n\nLorem ipsum blue',
+ altText: 'Blue background',
+ },
+ {
+ background: MyColourBackground,
+ backgroundProps: { colour: 'green' },
+ foreground: '#### Step 3\n\nLorem ipsum green',
+ altText: 'Green background',
+ },
+ ];
-
```
diff --git a/src/components/Scroller/stories/docs/interactive.md b/src/components/Scroller/stories/docs/interactive.md
index c7d4a003..1586b2d1 100644
--- a/src/components/Scroller/stories/docs/interactive.md
+++ b/src/components/Scroller/stories/docs/interactive.md
@@ -1,22 +1,36 @@
Instead of just text, you can use any component in the foreground, too, and pass whatever props you need to it.
+If you're making your own custom foreground component, remember to add alt text describing the background graphic.
+
```svelte
-
```
diff --git a/src/components/Scroller/stories/docs/quickit.md b/src/components/Scroller/stories/docs/quickit.md
index b3438765..b6b02189 100644
--- a/src/components/Scroller/stories/docs/quickit.md
+++ b/src/components/Scroller/stories/docs/quickit.md
@@ -35,18 +35,22 @@ StackBackground: true
Lorem ipsum
:end
+ AltText: A map showing the Upper West side in New York City.
Background: AiMap2
Text: #### Step 2
Lorem ipsum
:end
+ AltText: The same map now highlights 98th Street.
Background: AiMap3
Text: #### Step 3
Lorem ipsum
:end
+ AltText: The same map now highlights three locations near 98th Street where something particulary important happened.
+
[]
```