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

Can't register property? #32

Closed
saidwho12 opened this issue Jan 18, 2024 · 2 comments
Closed

Can't register property? #32

saidwho12 opened this issue Jan 18, 2024 · 2 comments

Comments

@saidwho12
Copy link

I'm trying to use asmcss to register an option, my code looks like:

:root {
  --aspect-ratio--register: true;
}

however, it seems like it's not working when I use it later in a div

<div xs="w:100%; aspect-ratio:4/3">
	...
</div>

when I look at the browser dev panel there is no aspect-ratio property used on that element at all.

@saidwho12
Copy link
Author

I'm importing asmcss in the following way:

      <script
        type="text/javascript" src="/static/js/assembler.min.js"
        data-generate="true"
        data-x-style-attribute="xs"
        data-mode="mobile-first">
      </script>

this is at the end of the body tag

@saidwho12
Copy link
Author

saidwho12 commented Jan 18, 2024

nvm figured it out, this doesn't work if the CSS is loaded from a file it seems like. You have to to it inline like the following:

<style>
  :root {
    --primary: #319dfc;
    --aspect-ratio--register: true;
  }
</style>

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