Readapt the misuse of BEM, Code organization
- -- is only for a modifier, not a child "child". Use master__child without the parent__ in it to make it more readable. https://www.smashingmagazine.com/2016/06/battling-bem-extended-edition-common-problems-and-how-to-avoid-them/ - Redefine atom design components
This commit is contained in:
85
src/style/molecules/_location.scss
Normal file
85
src/style/molecules/_location.scss
Normal file
@@ -0,0 +1,85 @@
|
||||
// Location
|
||||
.location {
|
||||
position: relative;
|
||||
margin-bottom: 48px;
|
||||
|
||||
@include breakpoint (sm) {
|
||||
margin-left: pxVW(72);
|
||||
margin-right: pxVW(72);
|
||||
}
|
||||
@include breakpoint (xl) {
|
||||
margin-left: 72px;
|
||||
margin-right: 72px;
|
||||
}
|
||||
|
||||
a {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
// Flag image
|
||||
img {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
border-radius: 50vh;
|
||||
}
|
||||
|
||||
// City
|
||||
&__city {
|
||||
font-family: $font-serif;
|
||||
font-size: rem(32px);
|
||||
color: $color-secondary;
|
||||
|
||||
@include breakpoint (sm) {
|
||||
font-size: rem(48px);
|
||||
}
|
||||
}
|
||||
.mask-city {
|
||||
height: 40px;
|
||||
margin: 24px 0 16px;
|
||||
|
||||
@include breakpoint (sm) {
|
||||
height: 64px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
}
|
||||
.mask-country {
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
// Hover
|
||||
&:hover {
|
||||
.location__city {
|
||||
color: $color-tertiary;
|
||||
}
|
||||
|
||||
&:after {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, -50%) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Shape on hover
|
||||
&:after {
|
||||
content: "";
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%) scale(0.94);
|
||||
display: block;
|
||||
width: 216px;
|
||||
height: 216px;
|
||||
background: rgba($color-lightpurple, 0.3);
|
||||
border-radius: 50vh;
|
||||
transition: all 85ms ease-in-out;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user