It's a little shameful but I still struggle when centering divs on a page. Yes, I know about flexbox for more than a decade but always have to search to remember how it is done.
So instead of refreshing that less used knowledge I just ask the AI to do it for me. The implications of this vs searching MDN Docs is another conversation to have.
Hah, centering divs with flexbox is one of my uses for this too! I can never remember the syntax off the top of my head, but if I say "center it with flexbox" it spits out exactly the right code every time.
If I do this a few more times it might even stick in my head.
> Yes, I know about flexbox for more than a decade but always have to search to remember how it is done.
These days I use display: flex; so much that I wish the initial value of the display property in CSS should be flex instead of inline;
Try tailwind. Very amenable to LLM generation since it's effectively a micro language, and being colocated with the document elements, it doesn't need a big context to zip together.
Surely searching "centre a div" takes less time than prompting and waiting for a response...
No shame in that. I keep struggling to figure out the point of view of the CSS designers.
They don't think like graphic designers, or like programmers. It's not easy for beginners. It's not aimed at ease of implementation. It's not amenable to automated validation. It's not meant to be generated.
If there is some person for whom CSS layout comes naturally, I have not met them. As far as I can tell their design goal was to confuse everyone, at which they succeeded magnificently.