Answer the question
In order to leave comments, you need to log in
What is the best way to set the outer geometry for bem blocks?
There is a tile block, here is its description:
.title {
@include heading-h2;
display: block;
margin-bottom: 64px;
@media (width < $media-1200) {
@include heading-h4;
}
@media (width < $media-768) {
@include heading-h6;
}
@media (width < $media-576) {
@include body-middle-semibold;
}
&--mb-small {
margin-bottom: 24px;
@media (width < $media-576) {
margin-bottom: 16px;
}
}
&--mb-big {
margin-bottom: 64px;
@media (width < $media-1200) {
margin-bottom: 40px;
}
@media (width < $media-576) {
margin-bottom: 32px;
}
}
&--center {
text-align: center;
}
}
.title--mb-def
Answer the question
In order to leave comments, you need to log in
Outer padding and positioning relative to parent blocks must be done using modifiers or mixes. With modifiers we define the basic styles, with mixes we redefine the styles in the context of the current block.
well, if directly according to the canons of BEM, then any external geometry is specified in the elements.
Your title is an element of some external block, so mix it up.
.block
.block__title.title
.block__title {
margin-bottom: 1rem;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question