Giter Site home page Giter Site logo

Comments (5)

WebReflection avatar WebReflection commented on May 27, 2024

it should be unambiguous, meaning I can check if it's string or not ... not sure why I haven't cough this before, so it looks like a valid bug.

That being said, if pos has only left and top properties, you can as well write:

<div class='face-square' style=${pos}>x</div>

and call it a day, yet I'd like to investigate more about this issue 👍

from hyperhtml.

WebReflection avatar WebReflection commented on May 27, 2024

I'm afraid hyperhtml-style already differentiate between objects and strings, so something else might be off in here ...

from hyperhtml.

WebReflection avatar WebReflection commented on May 27, 2024

I've just tested this on code pen:
https://codepen.io/WebReflection/pen/KKMJNRL?editors=0010

all good, closing until further tests to validate the bug are provided, as I think this isn't actually right.

from hyperhtml.

WebReflection avatar WebReflection commented on May 27, 2024

P.S. one thing I can imagine happening in here, is that while passing an object would threat numbers as pixels, if you pass along a number CSS would ignore it.

Have you tried doing this instead?

hyperHTML.wire()`<div style=${`top:${pos.top}px; left:${pos.left}px;`}>x</div>`;

Please note the px suffix, as I think that's your issue.

from hyperhtml.

danielo515 avatar danielo515 commented on May 27, 2024

Yes, it was the lack of px what made CSS ignore the number. I thought it was hyperHTML processing the number in the wrong way, loosing the ref or whatever.
Thanks.

from hyperhtml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.