Complete the code to nest the modifier class using & in BEM style.
.button {
color: blue;
&[1] {
color: red;
}
}In BEM, modifiers are added with two dashes --. Using &--active nests the modifier class .button--active.
Complete the code to nest the element class inside the block using & with BEM naming.
.card {
background: white;
&[1] {
padding: 1rem;
}
}In BEM, elements are connected to blocks with two underscores __. Using &__header nests the element class .card__header.
Fix the error in nesting the modifier class with & in BEM style.
.menu {
font-size: 1rem;
&[1] {
font-weight: bold;
}
}__active for modifiers.The correct BEM modifier syntax uses two dashes --. Using &--active nests the modifier class .menu--active.
Fill both blanks to nest an element and a modifier inside a block using & with BEM naming.
.nav {
&[1] {
color: black;
}
&[2] {
color: gray;
}
}Elements use __ and modifiers use -- in BEM. So &__link creates .nav__link and &--active creates .nav--active.
Fill all three blanks to create a nested BEM structure with block, element, and modifier using &.
.form {
&[1] {
margin: 1rem 0;
}
&[2] {
font-weight: normal;
}
&[3] {
font-weight: bold;
}
}Elements use __ and modifiers use --. So &__label creates .form__label, &--disabled creates .form--disabled, and &--focused creates .form--focused.