diff options
author | 2022-01-31 16:56:14 -0500 | |
---|---|---|
committer | 2022-01-31 16:56:14 -0500 | |
commit | 3d2c184962925300ca75c96b8115f88e68140ec7 (patch) | |
tree | a8335ba3634f03bca3f08d97a6be80af57ff43de /examples/fast-build/src | |
parent | 187d5128af9ea388589f12e7b062b1e6a38ac67a (diff) | |
download | astro-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.astro | 13 |
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> |