The nice touch is that you can set a maxWidth for the swiping to kick in, giving the app a very native feel on mobile devices.
Give it a go and let me know what you think!
11 karma · joined December 24, 2019
The nice touch is that you can set a maxWidth for the swiping to kick in, giving the app a very native feel on mobile devices.
Give it a go and let me know what you think!
1) I thought of giving an easier to read example. I just moved the example to react, so the snippets actually match exactly what's going on in the background.
2) It is true! Though, using shadows on the optimized code doesn't slow it down. I added more toggles to test same effects on transform and top/left implementations.
3) I think it's still interesting to start with some thought and then observe that in practice things are different really. In fact, thanks for all the feedback, as it made me go back and do more investigation.
If you don't mind you can give the article a second look now :)
Every time we scroll, hover, or trigger an animation, the browser goes through a whole routine. It calculates styles, figures out layout, paints pixels, and puts everything together on screen. All of that happens in just a few milliseconds.
It’s kind of wild how much is happening behind what feels instant. And the way we write code can make that process either smooth and fluid or heavy and janky.
I wrote an article that walks through this step by step, with a small demo showing exactly how these browser processes work and how a few CSS choices can make a big difference.
I wanted to explore svelte a bit, and thought of an AmAzInG use case for it. I said to myself: I am going to build a chess board so I can play with some of the svelte features.. not quite. Of course, it turns out that there is a lot of board logic and not much svelte magic lol.
Anyways, I spent a fair amount of time on it, so I thought of sharing to give it some justice.. If someone is a decent player, did I implement the rules well?
https://github.com/luciodale/react-searchable-dropdown/blob/...
It turned out to be quite simple as I expected.. you can check the demo on the site too
I think this gets close to what most people actually need from a dropdown without making you glue together a bunch of separate pieces. Hopefully it saves someone else the time I spent chasing edge cases. Feedback is very much welcome.