summaryrefslogtreecommitdiff
path: root/examples/fast-build/src
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2022-01-31 16:56:14 -0500
committerGravatar GitHub <noreply@github.com> 2022-01-31 16:56:14 -0500
commit3d2c184962925300ca75c96b8115f88e68140ec7 (patch)
treea8335ba3634f03bca3f08d97a6be80af57ff43de /examples/fast-build/src
parent187d5128af9ea388589f12e7b062b1e6a38ac67a (diff)
downloadastro-3d2c184962925300ca75c96b8115f88e68140ec7.tar.gz
astro-3d2c184962925300ca75c96b8115f88e68140ec7.tar.zst
astro-3d2c184962925300ca75c96b8115f88e68140ec7.zip
Fix define:vars in the static build flag (#2511)
* Fix define:vars in the static build flag * Adds a changeset * linting
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>