-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Make Lost-Offset work more intuitively (reverse of current +/- behavior) #184
Comments
I've thought the same thing...I wonder if it has to do with the actual math that's going on. |
Whatever math is, there is no problem to * -1 in code :) |
I agree. I thought about whether or not I might fix this a while back but then our old code would need some rework. I'd be curious to know why, like yourself, if there is something I'm missing. |
Hi, I'm playing with Lost grid on Codepen. Struggled with this too. My first attempt, with expected behaviors similar to other grid systems, Bootstrap, Materialize, Bourbon/Neat, I tried to offset to "push it" to the right, with a positive value of the number of columns I needed. For example, from Materialize And got nothing. Found this issue and tried negative, and got what I wanted. The Offsetting Elements section in Readme could use a clearer update. Will try to submit a PR. Might be worth an API change on next major update. |
Yeah, sorry guys, this was actually a mistake that slipped in somewhere, or maybe I've just always thought of it backwards. You guys all seem to agree that this is screwy so I definitely give the 👍 to convert this in 7 (super easy change). |
Great, thanks @corysimmons! |
Thanks for clarifying @corysimmons. I was curious about this myself. I'll update as an actionable issue. |
To make this work, it's going to do some breaking. 7.0.0 is going to make |
Perhaps instead of introducing a global setting specifically to cover up a mistake, we could make a script or something that would recursively traverse every file in a directory, regex for Then just add a link to the update script in 7.0.0 changelog. |
@gwww 👍 |
I got started on it but couldn't figure out the whole readline https://github.com/corysimmons/lost-offset-upgrader.js/blob/master/lost-offset-upgrader.js |
@corysimmons what if someone doesn't put space between property and value And one more thing to consider: no script can guarantee 100% transform |
We can split/trim at colon so it wouldn't matter if they had For someone to get burned they would have to:
I think at that point I wouldn't feel too bad about it. I agree with you on the whole node: property AST stuff with PostCSS, but how would implementing that look? You'd make a PostCSS plugin the user had to configure into their gulpfile, run their gulpfile one time (and only one time), and then remove it from their gulpfile? That script took 5 mins to make. I'm totally open minded to other solutions. My only concern was introducing new global variables to Lost and cluttering the API. :) |
While I'm generally against globals, in this case I am OK with it since the global variable is temporal. My preference is good changelog doc that says new behavior, work around for old behavior, and strict timeline for when deprecated behavior will disappear totally. My preference is because writing a script to "fix" old behavior is likely to be a source of much discussion in the form of "does it work in case ". Just my humble opinion as a newb here. |
You're suggesting adding a temporary global variable that will get removed in 8.0.0 or something? That might work. |
Correct. Stays around until next major release or 6 months - whichever comes first. Perhaps:
Some projects, elixir for example, uses soft-deprecation then hard-deprecation. As I understand it soft keeps the feature around for months with changelogs and other mechanisms. Hard removes the feature. |
I am a fan of what @gwww said. Scripts are cool, and I think we could offer one, but I was thinking about a global setting that would allow for users to continue using Lost w/o having to do a large code-change. |
Any updates on this? I can't find any information in the release notes for the 7.0.* releases. |
@perkola I haven't put any time into this. I'm thinking this might wrap nicely into the Node updates/depreciation that's coming. |
PLEASE add a byline about the negative offset in the existing docs. You made me question my very existence as a front-ender. :) |
I'm sorry!!! 😫 |
@corysimmons You're all good. 😄 |
This reverses the current api from moving left to right based on negative fractions which didn’t make much sense. This breaks that api’s current functionality and makes it more intuitive
This is now in the Beta channel: http://peter.coffee/lostgrid-gets-beta-8-0-0 🎉 |
Thank you! |
@hudochenkov Let me know if you have any issues with the beta! |
@peterramsing Perhaps codepen has integrated with Lost v7.1., |
@asifshirazi It looks like CodePen isn't up to date. I'll tweet them and see if it can get updated. |
@peterramsing Coyier mentioned to me they were steering away from messing with PostCSS. Luckily, Jonathan Neal figured out a workaround: https://codepen.io/jonneal/post/testing-postcss-plugins Now you can update without waiting or anything. |
In every grid systems offset always applied to the left side of the block, but in Lost it's applied to the right. Luckily we can apply offset to usual side by negative value, but it's counterintuitive.
What is the reason for this behaviour?
The text was updated successfully, but these errors were encountered: