{"action":"created","issue":{"url":"https://api.github.com/repos/STRML/react-grid-layout/issues/104","labels_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/104/comments","events_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/104/events","html_url":"https://github.com/STRML/react-grid-layout/issues/104","id":107796004,"number":104,"title":"horizontal units as percentages","user":{"login":"benmosher","id":3709196,"avatar_url":"https://avatars.githubusercontent.com/u/3709196?v=3","gravatar_id":"","url":"https://api.github.com/users/benmosher","html_url":"https://github.com/benmosher","followers_url":"https://api.github.com/users/benmosher/followers","following_url":"https://api.github.com/users/benmosher/following{/other_user}","gists_url":"https://api.github.com/users/benmosher/gists{/gist_id}","starred_url":"https://api.github.com/users/benmosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmosher/subscriptions","organizations_url":"https://api.github.com/users/benmosher/orgs","repos_url":"https://api.github.com/users/benmosher/repos","events_url":"https://api.github.com/users/benmosher/events{/privacy}","received_events_url":"https://api.github.com/users/benmosher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-22T20:33:22Z","updated_at":"2015-09-22T21:05:15Z","closed_at":null,"body":"Would you be open to a PR that changes all the width calculations from pixel values to percentages?\r\n\r\nAlso: any obvious gotchas to a percentage-based column width system? I think it might remove the dependency on the window `resize` event and would empower the browser to animate width changes as necessary.\r\n\r\nI am not sure what sort of server-side rendering you're trying to preserve, but assuming the end client is still a browser, I don't see any issues there. \r\n\r\nAFAICT the `transform` styles accept mixed units (i.e. `translate(5%, 14px)`) so I don't think there is any gotcha there, either.\r\n\r\nI may need to fork and provide this functionality anyway. Just curious if you'd consider merging it back in and/or you've tried it and it fails for [x reason].\r\n\r\nThanks! 😄"},"comment":{"url":"https://api.github.com/repos/STRML/react-grid-layout/issues/comments/142421470","html_url":"https://github.com/STRML/react-grid-layout/issues/104#issuecomment-142421470","issue_url":"https://api.github.com/repos/STRML/react-grid-layout/issues/104","id":142421470,"user":{"login":"benmosher","id":3709196,"avatar_url":"https://avatars.githubusercontent.com/u/3709196?v=3","gravatar_id":"","url":"https://api.github.com/users/benmosher","html_url":"https://github.com/benmosher","followers_url":"https://api.github.com/users/benmosher/followers","following_url":"https://api.github.com/users/benmosher/following{/other_user}","gists_url":"https://api.github.com/users/benmosher/gists{/gist_id}","starred_url":"https://api.github.com/users/benmosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmosher/subscriptions","organizations_url":"https://api.github.com/users/benmosher/orgs","repos_url":"https://api.github.com/users/benmosher/repos","events_url":"https://api.github.com/users/benmosher/events{/privacy}","received_events_url":"https://api.github.com/users/benmosher/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T21:05:15Z","updated_at":"2015-09-22T21:05:15Z","body":"Ah, interesting points. I forgot about the `translate` percentage scope. That should just be something like `width of 1 column (%) * x column position * (total columns / item column width)`, right? A little weird, but doable. i.e. item at x=2, w=2 on a 4-wide grid is thus positioned at 100%.\r\n\r\nMargins are a loose end. `calc([margin]px + [position]%)` seems to be viable as a `translate` unit (in Chrome beta, at time of writing), though it's pretty crazy looking.\r\n\r\nIt can be assumed the window won't resize during any grid item drag/resize event--right?--so any relevant pixel width info (be it for the item or the full grid) could be requested at the start of the mutation.\r\n\r\nI'm not sure when I might dig into this, but I'll let you know if I get anywhere with it."}}