summaryrefslogtreecommitdiff
path: root/examples/fast-build/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/fast-build/src')
-rw-r--r--examples/fast-build/src/pages/index.astro13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/fast-build/src/pages/index.astro b/examples/fast-build/src/pages/index.astro
index 24ec0039a..4d13ae5a5 100644
--- a/examples/fast-build/src/pages/index.astro
+++ b/examples/fast-build/src/pages/index.astro
@@ -22,6 +22,11 @@ import ExternalHoisted from '../components/ExternalHoisted.astro';
color: purple;
}
</style>
+ <style define:vars={{ color: 'blue' }}>
+ .define-vars h1 {
+ color: var(--color);
+ }
+ </style>
</head>
<body>
<section>
@@ -58,5 +63,13 @@ import ExternalHoisted from '../components/ExternalHoisted.astro';
<InlineHoisted />
<ExternalHoisted />
</section>
+
+ <section class="define-vars">
+ <h1>define:vars</h1>
+ <h2></h2>
+ <script define:vars={{ color: 'blue' }}>
+ document.querySelector('.define-vars h2').textContent = `Color: ${color}`;
+ </script>
+ </section>
</body>
</html>