Answer the question
In order to leave comments, you need to log in
What is the best way to write styles in scss?
If I have such html
<div class="result-container">
<img src="/src/views/AppVIew/images/SM_Icon_Youtube.png" alt="" class="result-container-image">
<a href="https://www.youtube.com/watch?v=wiTujJZ4G0k" class="result-container-link"></a>
<p class="result-container-author">test user</p>
<p class="result-container-date">test date</p>
<p class="result-container-viewCount"> test view count</p>
</div>
.result-container {
max-width: 200px;
img {
max-width: 100%;
}
p {
color:red;
}
}
Answer the question
In order to leave comments, you need to log in
Look towards BEM
https://ru.bem.info/
in particular
https://ru.bem.info/methodology/naming-convention/
Depends on the methodology you want to follow.
In addition to the mentioned Daniil Popov BEM, you can also pay attention to:
- Atomic CSS
- MCSS
- SMACSS
You can first read an overview of these methodologies on Habré:
https://habr.com/ru/post/256109/
And choose what you need like it and fit better.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question