Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoist style tag variable declaration #41

Open
AngusMorton opened this issue Apr 17, 2023 · 0 comments
Open

Hoist style tag variable declaration #41

AngusMorton opened this issue Apr 17, 2023 · 0 comments

Comments

@AngusMorton
Copy link
Contributor

Currently, style tag declarations (<style/{ test}>) are not hoisted and so need to be placed above their usage, which means that we need to declare our styles above our view code.

The following code gives an error "Cannot access 'test' before initialization":

<let/count=0/>
<button onClick() { count++ } class=test>
  ${count}
</button>

<style/{ test }>
  .test {
    background: red;
  }
</style>

It would be nice to be able to declare the style tag variables wherever we wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant