Answer the question
In order to leave comments, you need to log in
What is the best way to modify a block?
I have a block that needs to be modified, here it is:
<div class="user-profile">
<div class="user-profile__avatar"></div>
<div class="user-profile__name">Имя пользователя</div>
<div class="user-profile__button">Сказать привет!</div>
</div>
<div class="user-profile user-profile--small">
<div class="user-profile__avatar"></div>
<div class="user-profile__name">Имя пользователя</div>
<div class="user-profile__button">Сказать привет!</div>
</div>
.user-profile {
$self: &;
&__avatar {/* ... */}
&__name {/* ... */}
&__button {/* ... */}
&--small {
#{$self}__avatar {
width: 22px;
height: 22px;
}
#{$self}__name {
color: $pink;
}
#{$self}__button {
width: 100%;
}
}
}
<div class="user-profile">
<div class="user-profile__avatar user-profile__avatar--small"></div>
<div class="user-profile__name user-profile__name--small user-profile__name--pink">Имя пользователя</div>
<div class="user-profile__name user-profile__name--fluid">Сказать привет!</div>
</div>
.user-profile {
&__avatar {
/* ... */
&--small {
width: 22px;
height: 22px;
}
}
&__name {
/* ... */
&--pink {
color: $pink;
}
}
&__button {
/* ... */
&--fluid {
width: 100%;
}
}
}
<table class="table-def table-def--font-small">
<tr class="table-def__header">
<td>№</td>
<td>Скажи привет!</td>
</tr>
<tr class="table-def__body">
<td>1</td>
<td>Хай</td>
</tr>
<tr class="table-def__body">
<td>1</td>
<td>Хаай</td>
</tr>
<!-- 99+ lines -->
</table>
<table class="table-def">
<tr class="table-def__header">
<td>№</td>
<td>Скажи привет!</td>
</tr>
<tr class="table-def__body table-def__body--font-small">
<td>1</td>
<td>Хай</td>
</tr>
<tr class="table-def__body table-def__body--font-small">
<td>1</td>
<td>Хаай</td>
</tr>
<!-- 99+ lines -->
</table>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question