Skip to content

Commit adb4db1

Browse files
consistent indentation in scripts
1 parent b3352d5 commit adb4db1

File tree

1 file changed

+44
-48
lines changed

1 file changed

+44
-48
lines changed

src/content/docs/en/reference/modules/astro-transitions.mdx

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,21 @@ const { scope, styles } = createAnimationScope("gallery", {
169169

170170
## Imports from `astro:transitions/client`
171171

172-
```astro
173-
<script>
174-
import {
175-
getFallback,
176-
isTransitionBeforePreparationEvent,
177-
isTransitionBeforeSwapEvent,
178-
navigate,
179-
supportsViewTransitions,
180-
swapFunctions,
181-
transitionEnabledOnThisPage,
182-
TRANSITION_AFTER_PREPARATION,
183-
TRANSITION_AFTER_SWAP,
184-
TRANSITION_BEFORE_PREPARATION,
185-
TRANSITION_BEFORE_SWAP,
186-
TRANSITION_PAGE_LOAD,
187-
} from 'astro:transitions/client';
188-
</script>
172+
```ts
173+
import {
174+
getFallback,
175+
isTransitionBeforePreparationEvent,
176+
isTransitionBeforeSwapEvent,
177+
navigate,
178+
supportsViewTransitions,
179+
swapFunctions,
180+
transitionEnabledOnThisPage,
181+
TRANSITION_AFTER_PREPARATION,
182+
TRANSITION_AFTER_SWAP,
183+
TRANSITION_BEFORE_PREPARATION,
184+
TRANSITION_BEFORE_SWAP,
185+
TRANSITION_PAGE_LOAD,
186+
} from 'astro:transitions/client';
189187
```
190188

191189
### `navigate()`
@@ -431,11 +429,11 @@ A constant to avoid writing the `astro:before-preparation` event name in plain t
431429
---
432430
433431
<script>
434-
import { TRANSITION_BEFORE_PREPARATION } from "astro:transitions/client";
432+
import { TRANSITION_BEFORE_PREPARATION } from "astro:transitions/client";
435433
436-
document.addEventListener(TRANSITION_BEFORE_PREPARATION, () => {
437-
/* the listener logic */
438-
});
434+
document.addEventListener(TRANSITION_BEFORE_PREPARATION, () => {
435+
/* the listener logic */
436+
});
439437
</script>
440438
```
441439

@@ -454,11 +452,11 @@ A constant to avoid writing the `astro:after-preparation` event name in plain te
454452
---
455453
456454
<script>
457-
import { TRANSITION_AFTER_PREPARATION } from "astro:transitions/client";
455+
import { TRANSITION_AFTER_PREPARATION } from "astro:transitions/client";
458456
459-
document.addEventListener(TRANSITION_AFTER_PREPARATION, () => {
460-
/* the listener logic */
461-
});
457+
document.addEventListener(TRANSITION_AFTER_PREPARATION, () => {
458+
/* the listener logic */
459+
});
462460
</script>
463461
```
464462

@@ -477,11 +475,11 @@ A constant to avoid writing the `astro:before-swap` event name in plain text whe
477475
---
478476
479477
<script>
480-
import { TRANSITION_BEFORE_SWAP } from "astro:transitions/client";
478+
import { TRANSITION_BEFORE_SWAP } from "astro:transitions/client";
481479
482-
document.addEventListener(TRANSITION_BEFORE_SWAP, () => {
483-
/* the listener logic */
484-
});
480+
document.addEventListener(TRANSITION_BEFORE_SWAP, () => {
481+
/* the listener logic */
482+
});
485483
</script>
486484
```
487485

@@ -500,11 +498,11 @@ A constant to avoid writing the `astro:after-swap` event name in plain text when
500498
---
501499
502500
<script>
503-
import { TRANSITION_AFTER_SWAP } from "astro:transitions/client";
501+
import { TRANSITION_AFTER_SWAP } from "astro:transitions/client";
504502
505-
document.addEventListener(TRANSITION_AFTER_SWAP, () => {
506-
/* the listener logic */
507-
});
503+
document.addEventListener(TRANSITION_AFTER_SWAP, () => {
504+
/* the listener logic */
505+
});
508506
</script>
509507
```
510508

@@ -523,27 +521,25 @@ A constant to avoid writing the `astro:page-load` event name in plain text when
523521
---
524522
525523
<script>
526-
import { TRANSITION_PAGE_LOAD } from "astro:transitions/client";
524+
import { TRANSITION_PAGE_LOAD } from "astro:transitions/client";
527525
528-
document.addEventListener(TRANSITION_PAGE_LOAD, () => {
529-
/* the listener logic */
530-
});
526+
document.addEventListener(TRANSITION_PAGE_LOAD, () => {
527+
/* the listener logic */
528+
});
531529
</script>
532530
```
533531

534532
## `astro:transitions/client` types
535533

536-
```astro
537-
<script>
538-
import type {
539-
Direction,
540-
Fallback,
541-
NavigationTypeString,
542-
Options,
543-
TransitionBeforePreparationEvent,
544-
TransitionBeforeSwapEvent,
545-
} from 'astro:transitions/client';
546-
</script>
534+
```ts
535+
import type {
536+
Direction,
537+
Fallback,
538+
NavigationTypeString,
539+
Options,
540+
TransitionBeforePreparationEvent,
541+
TransitionBeforeSwapEvent,
542+
} from 'astro:transitions/client';
547543
```
548544

549545
### `Direction`

0 commit comments

Comments
 (0)