@Pawel-Gnat
Posted
Hi mate. I've checked your code and my only advice is - try to code with a repeatable method.
Let me give you an example.
Your code:
.rating {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
}
.each-rating {
color: var(--Very-Dark-Magenta);
font-weight: 700;
padding: 1rem 0;
margin-bottom: 1rem;
width: 100%;
background: var(--Light-Grayish-Magenta);
border-radius: 0.3rem;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
Corrected code:
.rating {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
}
.each-rating {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
color: var(--Very-Dark-Magenta);
font-weight: 700;
padding: 1rem 0;
margin-bottom: 1rem;
background: var(--Light-Grayish-Magenta);
border-radius: 0.3rem;
text-align: center;
}
See the difference? It's easier to work in a group if your code have some kind of styling order.
Marked as helpful
@EngineerHamziey
Posted
@Pawel-Gnat I'm sorry for stressing you, could you please explain what you mean by repeatable? And I personally think that order does not matter.
Kindly let me know why you think it matters.
@Pawel-Gnat
Posted
@EngineerHamziey I heard once in a discord group that when we write our code we should stick to one styling schema.
For example:
styled_element {
1. position code
2. display code
3. margin/padding code
4. width/height code
5. color
6. border
7. font code
8. and many more..
}
Apparently, if we stick to one styling scheme in a working team it helps to provide further code upgrades. But it was just a suggestion that I found useful :)
Marked as helpful
@EngineerHamziey
Posted
@Pawel-Gnat thanks so much, I'll research more about it when I'm less busy. Oh yh, @vanzasetia, what is your opinion?
@vanzasetia
Posted
@EngineerHamziey I used csscomb npm package to help me order the properties automatically. But, it is not a necessary thing to do. You can write the CSS properties randomly.
I agree with @Pawel-Gnat, it might be more beneficial if you are working with a team (I never work with a team at least until now 😅).
So, it is up to you, Hamzat. You can do it if you want. 😉
Marked as helpful