Giter VIP home page Giter VIP logo

Comments (5)

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024 1

Hi @lozandier
paper-toast alignment abilities is not a lie, you just have to use it right:

  • have a look at how to use polygit.org, you should point to paper-toast master branch -> polygit.org/paper-toast+:master/components/
  • fitInto must be an HTMLElement, not a string (you passed an id of an element that is not in the document root, but inside the x-test root, hence document.getElementById('section') won't work) -> set it on ready, or bind it to a private x-test property (whatever is more convenient for you)
  • verticalOffset must be a number, not a string (s/10vh/10); it is the same as setting margin-top/margin-bottom in css
  • s/vertialAlign/verticalAlign
  • s/vertialOffset/verticalOffset

Here you go http://jsbin.com/nehejo/2/edit?html,output

from paper-toast.

lozandier avatar lozandier commented on July 19, 2024 1

Understood, thanks for the thorough response to this, @valdrinkoshi; have a splendid weekend.

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

FYI, published v1.3.0, so no need to point to the master branch

from paper-toast.

lozandier avatar lozandier commented on July 19, 2024

@valdrinkoshi Epic use of emojis .

Terrible typos & misuses on my part trying to recreate the issues (including the fitInto part that was an error with my example, but was correctly referencing an actual element programmatically prior to spending time creating an isolated use case from my colleague's futile efforts).

There's still confusing behavior I wouldn't mind for you to clear-up that I and my colleague whose code lead me to write this issue:

  1. If setting verticalOffsest is the same as setting margin-top/margin-bottom in CSS, why can't units be used like vh or I'm misunderstanding that statement? I'm of the opinion that statement assumes that the string be scrutinized by methods not enabling consumers to specify the units they find most useful.
  2. While knowing (but somehow forgetting in my glee of having an real world opportunity to use "The Cake Is Lie" meme for a Github issue) fitInto accepting an element node (HTMLElement) , wouldn't there be value for fitInto to accommodate being used programmatically & declaratively by accepting an element node OR a string? The string can be handled with logic like (typeof param === 'string')…this.parentElement.querySelector(query) || document.currentScript.ownerDocument.querySelector('query');`

I'd happily do a PR for that.

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

Hi @lozandier

  • verticalOffset, horizontalOffset, verticalAlign, horizontalAlign were previously properties of iron-dropdown, I moved them to iron-fit-behavior so that all overlays can benefit from them. verticalOffset, horizontalOffset in particular were kept in order not to make a breaking change, but ideally they should be deprecated/removed in favor of just using margins in css. That said, I believe it might be possible to accept a css value, feel free to give it a shot https://github.com/PolymerElements/iron-fit-behavior/blob/master/iron-fit-behavior.html#L286
  • About fitInto accepting a string, that could be a great enhancement!

Could you open an issue for each in https://github.com/PolymerElements/iron-fit-behavior/ & do the PR there please? 🍰

Closing this

from paper-toast.

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.