Show HN: I made a drag and drop CSS grid generator
cssgridgenerator.io
cssgridgenerator.io
If is not clear what I am saying, I can try to make a video or something.
1. Click the box in the bottom right corner to create a cell. 2. Click the box just to the left of that one to create another cell. 3. Drag the cell you created in step 2 to the right. The cell on the bottom right gets pushed downwards, below the grid's lower boundary.
(Chrome/Android)
The chrome dev tools are also useful as it allows you to modify a grid in place to instantly see your changes.
I wrote a post on grid here:
I think in general interaction between generator tools and hand written code is very difficult.
Once you start with one you cannot then use the other on the same code.
I recently picked up some front end work for the first time in about 15 years. Things have progressed so much, CSS grid is a dream but also the things that were horribly hacky in the 2000s with JS are now solved so well.
Not even talking about frameworks or react, with just vanilla CSS, JS and the mdn docs you can build really nice sites that were so so awkward to make before.
I'd encourage you to spend a few afternoons delving deep into this, a lot of the stuff I learnt years ago is still relevant and brings a solid foundation, it didn't take long to update my approach.
new-old school is to do spacer.base64.
A few years ago, I found a site generator similar to this one, but it wasn't drag and drop. I can't remember the name of the site.
From there I learned about grid-template-columns, gap, and some basic things about CSS grid. It didn't cover everything, but it introduced me to how the grid works when I was just learning about it.
Keep up the good work. It will always make it easy for people to learn, or use it directly.
I never got around to build some kind of internal framework for this, i ended up hacking away with flex (which was already the gamechanger – hail to the OGs from the times before flexbox). Then tailwind came along and after disregarding it for a long time, it ended up to fulfil every need i had for quickly doing responsive frontends quickly.
Still wondering if anyone knows good frameworks or examples of people using template areas as the main fundament for their layouting?
I'd like to try, but it's not important enough for me to build something well enough that can be used as a general base. Or maybe that doesn't even make much sense or much of a difference. Haven't even thought about it much.
Any thoughts on this are welcome.
Ah, also: nice work OP. I like it. Maybe you have some ideas about template areas yourself. I will definitely use your tool next time i fiddle around with grids.
I will say, personally, my problems with grid are usually centered around getting them to do the expected dynamic rearrangement, rather than just setting up the grids in the first place. It's always an MDN hunt, for me, when I want to get a grid to collapse to fewer columns rather than squish the columns (or vice-versa).
But, in general, it's always nice to have simple utilities like this to simplify those rote things we do all the time. I'm sure I'll be using it sooner rather than later!
One quick suggestion: if establishing grids set the state in the url, it would be trivial to send someone a link to your utility which had the grid they wanted. Not sure exactly how useful that would be, but I just figured I could pop a bunch of "standard" layouts into a text file as urls and that would make the utility easier to rely on, for me.
Then you will be able to see the HTML and all the calculated CSS properties of each element.
If he uses Tailwind CSS you should be able to look at the class-attributes of the elements to figure out how it all works.
Haven't done so myself, on mobile.
For example - is this CSS grid-generation/layout current best-practice for building the base, foundational layer for a simple static website? Say, with three columns, one centered and wider with content, the others narrow and empty - serving as margins?
And how would one arrive there, as a solution? Searching online turns up an infinity of options such that it's difficult if not impossible to figure out how to do things in if not maybe "the" right or best way, at least "a" right way.
An older resource for learning grid would be https://youtube.com/playlist?list=PLu8EoSxDXHP5CIFvt9-ze3Ing.... 6 years old but grid itself has gone mostly unchanged. https://css-tricks.com/snippets/css/complete-guide-grid/ https://css-tricks.com/snippets/css/a-guide-to-flexbox/
https://flexboxfroggy.com/ Is a good way to introduce yourself with the concepts of flexbox.
https://jsfiddle.net/gaby_de_wilde/5muq1tag/
I forget why I'm not using a single margin:auto, probably some weird edge case I didn't want to see ever again.
In summary (besides the layout-specific stuff which was great) - between the MDN documentation for learning and reference:
https://developer.mozilla.org/en-US/docs/Web
And, for checking compatiblity and common practice:
A n00b like me can get a decent handle on current best practice and standards for web dev. Feel levelled-up - much appreciated!