SASS with BEM hover state
.card {
$this: &;
&__hasFullImage {
&:hover {
#{$this}__header {}
}
}
SCSS target class before :hover - I had same issue
BEM nesting elements and hover effects
You can simply this selector by doing the following:
.list {
&__item:hover .list__link {
color: $secondary;
}
}
How do I apply :hover to multiple bem statements in sass?
This will work:
:hover.magic-sparkles {
&-red {
background: red;
}
&-blue {
background: blue;
}
&-green {
background: green;
}
}
CSS transition on hover using BEM and Sass
Try something like this instead:
.price__tooltip {
transition: all 0.2s ease-in;
opacity: 0;
[...]
}
.price__text:hover {
&+.price__tooltip{
opacity: 1;
}
}
}
With this, the sibling .price__tooltip should get his opacity to 1 when .price__text is in hover state.
Sass with BEM, inherit selector
If you insist on nesting everything, the best you can do is this:
.photo-of-the-day {
$root: &;
&--title{
font-size: 16px;
}
&:hover{
#{$root}--title {
text-decoration: underline;
}
}
}
Related Topics
Internet Explorer Incorrectly Calculates Percentage Height for Generated Content in Td
Disabling Font Ligatures CSS (Letter Combining)
Web Safe Font Weights - How to Get Thinner
How to Move Bootstrap 3 Carousel Caption Below Images
Change Font Sizes with Style Sheets for Rstudio Presentation
Div Margin-Bottom of a Proportion of Its Own Height
How to Reset 'Display' Property for Flex-Item
Navigation Tabs with Jquery Mobile Similar to Google Play Store
Flex-Grow Not Working in Internet Explorer 11
Styling Overlapping Annotations in Text with HTML <Span> Tags and CSS
Keep Bootstrap Columns in Same Row When Changing Size
Bootstrap4 Make All Input-Group-Addons Same Width
Bootstrap 3.0 - Vertically Align 3 Panels in The Same Row (Auto Height)
Bootstrap 4: How to Have a Full Width Navbar with The Content in a Container (Like The So Navbar)