Dear All,
One of my requirement for adding the styles to the teaser is as below. The teaser background color should be blue , as shown in below figure.
For this I have created the hometeaser.less file with the below contents.
/* MCK teaser home */
.cmp-teaser--home {
.cmp-teaser{
.cmp-teaser__title {
background-color: #054C70;
}
.cmp-teaser__description {
font-family: @font-family-serif;
}
}
}
I have added this hometeaser.less file to my teaser.less file , as shown below
Then I have added the policy and style in my editable template , as shown below.
But After that also , background color is not coming , as shown below. Can you please help me on this.
Solved! Go to Solution.
Views
Replies
Total Likes
Are you not able to see the style-brush or the style option "HomeTeaser" itself or otherwise the changes are not visible after applying the style option?
Use developer toolbar to validate the generated DOM structure. It should be something similar to mentioned below as Style System follows the descendant selector convention:
<div class="cmp-teaser--home"> // wrapper class
<div class="cmp-teaser"> // component specific class
<div class="cmp-teaser__title">..... </div>
<div class="cmp-teaser__description">..... </div>
</div>
</div>
Validate that the generated css has classes ".cmp-teaser--home .cmp-teaser .cmp-teaser__title {...}" and ".cmp-teaser--home .cmp-teaser .cmp-teaser__description {...}"
For displaying background color use:
/* MCK teaser home */
.cmp-teaser--home {
.cmp-teaser{
background: color_code_in_HEX;
.cmp-teaser__title {
background-color: #054C70;
}
.cmp-teaser__description {
font-family: @font-family-serif;
}
}
}
References:
Views
Replies
Total Likes
Are you not able to see the style-brush or the style option "HomeTeaser" itself or otherwise the changes are not visible after applying the style option?
Use developer toolbar to validate the generated DOM structure. It should be something similar to mentioned below as Style System follows the descendant selector convention:
<div class="cmp-teaser--home"> // wrapper class
<div class="cmp-teaser"> // component specific class
<div class="cmp-teaser__title">..... </div>
<div class="cmp-teaser__description">..... </div>
</div>
</div>
Validate that the generated css has classes ".cmp-teaser--home .cmp-teaser .cmp-teaser__title {...}" and ".cmp-teaser--home .cmp-teaser .cmp-teaser__description {...}"
For displaying background color use:
/* MCK teaser home */
.cmp-teaser--home {
.cmp-teaser{
background: color_code_in_HEX;
.cmp-teaser__title {
background-color: #054C70;
}
.cmp-teaser__description {
font-family: @font-family-serif;
}
}
}
References:
Views
Replies
Total Likes
What is the html of that component looks like once you apply that style ?
Views
Replies
Total Likes
After I put background: color_code_in_HEX; after.cmp-teaser , it is coming fine. .cmp-teaser{ background: color_code_in_HEX;
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies