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

@grid: 1 with the JS Api fails #49

Closed
patrikengborg opened this issue Mar 2, 2021 · 4 comments
Closed

@grid: 1 with the JS Api fails #49

patrikengborg opened this issue Mar 2, 2021 · 4 comments
Assignees
Labels

Comments

@patrikengborg
Copy link

Hi,

First of all, thanks for a great and very interesting lib!

I can't seem to get the grid to render when setting @grid to 1. I've tried all different combinations but nothing works until i change it to at least 2, or even 2x1.

The problem only seems to occur when using the JS Api to initialize and update the doodle.
If i place my doodle definition within the element, everything works as expected.

Would be grateful for a fix or workaround. Thanks!

@yuanchuan
Copy link
Member

Hi, could you provide some code please?

The following code works as expected:

<script>
  let doodle = document.createElement('css-doodle');
  document.body.appendChild(doodle);

  doodle.update(`
    @grid: 1 / 300px;
    background: red;
  `);
</script>

@patrikengborg
Copy link
Author

That actually fails for me, but I'm using Nuxt, so it's probably due to some SSR trickery then.

However, I found a workaround. If I'm adding the @grid definition to the element, and then doodle.update(...), it works.

<css-doodle ref="doodle"> @grid: 1 / 100%; </css-doodle>

I don't know what's going on here, but at least I got it working, so I'm happy.

Thanks for your reply!

@yuanchuan yuanchuan added the bug label Mar 4, 2021
@yuanchuan yuanchuan self-assigned this Mar 4, 2021
@yuanchuan
Copy link
Member

Should be fixed now in 0.15.0

@yuanchuan
Copy link
Member

Closing it. Let me know if this issue is still there!

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

No branches or pull requests

2 participants