I’m writing a new book (https://www.producthunt.com/upco...) that teaches you how to write CSS from scratch and I’m curious about what people find the most difficult with CSS.
I’m also due to write some more posts on my blog (https://andy-bell.design/), so it’ll be great to get some ideas!
One thing I wish I'd understood earlier is the danger of being over specific with selectors – specifically chaining selectors.
Something that might be a more advanced topic in this area is how to deal with other people's CSS when they chain selectors without doing it yourself.
To learn good practices and go for a more advanced level I would like to highlight, if it helps:
* Avoid styling inline (in HTML) and the priority facts: Why inline HTML CSS is more “urgent” than the properties from css file. Or also in cases when you set “!important” or element is nested.
* The use of preprocessors SASS/LESS: having separate files and compress in one single output is a good dev practice. Plus you can define mixins and variables for a more clean and scalable project.
@david_m3 I certainly agree with point one, but I think getting the basics nailed in pure CSS is good to do before getting into preprocessors. It’s good for beginners to know where the native language stops and the preprocessor starts.
I’d say the same for frameworks too, in both CSS and JavaScript.
For me it would be the cascade, especially with lists. The other thing is child, sibling, I don't even know what they are called, selectors? Like * > + and how the effect the CSS. I recently discovered p + p to select all p tags exept first.
I must admit I am self tought and loved CSS when I first used it in 1999 doing my first site. Most of my work has been for me or friends, never really my income profession so I drop in & out of Front-end work. I do love what you are doing, thanks! It helps me a lot. & Grid LOL love Grid.