Brad Frost is my goto guy when it comes to CSS architectures.
If you start thinking in terms he is explaining, you can then start writing your components that way and it will be way more readable.
Also: semantics, MainDiv2 doesn't mean anything. Give your components readable names. It takes time to structure your components mentally but in the long run it pays off.
I suggest you read a topic of Atomic Design.
I have read a post about it and thought about using it as a design structure for the entirety of a React project. But it never occurred to me to use it just for the CSS.
semantics, MainDiv2 doesn't mean anything. Give your components readable names.
I completely agree and have nothing to say on the matter but shame on me :) Will definitely fix this.
I greatly appreciate your comment, applying atomic design on CSS(styled components) was not a method I had considered before, but I think you might have struck gold - I am seriously considering studying atomic design and rewriting most of the project. Thank you dearly for your suggestion.
Happy coding to you too! :)
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I see what your problem is. Its not the CSS. I don't like either version. I suggest you read a topic of Atomic Design.
bradfrost.com/blog/post/atomic-web...
Brad Frost is my goto guy when it comes to CSS architectures.
If you start thinking in terms he is explaining, you can then start writing your components that way and it will be way more readable.
Also: semantics, MainDiv2 doesn't mean anything. Give your components readable names. It takes time to structure your components mentally but in the long run it pays off.
Happy coding!
Thank you for the feedback Sanjin!
I suggest you read a topic of Atomic Design.
I have read a post about it and thought about using it as a design structure for the entirety of a React project. But it never occurred to me to use it just for the CSS.
semantics, MainDiv2 doesn't mean anything. Give your components readable names.
I completely agree and have nothing to say on the matter but shame on me :) Will definitely fix this.
I greatly appreciate your comment, applying atomic design on CSS(styled components) was not a method I had considered before, but I think you might have struck gold - I am seriously considering studying atomic design and rewriting most of the project. Thank you dearly for your suggestion.
Happy coding to you too! :)