Skip to content

Commit

Permalink
Refactor template BEM architecture and associated CSS files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrecoin committed Oct 16, 2020
1 parent 3a9382a commit 20c3396
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 75 deletions.
62 changes: 31 additions & 31 deletions assets/scss/components/slices/features.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
margin-bottom: 0;
}
}
}

.features-wrapper-row {
&__item {
display: flex;
align-items: center;
Expand All @@ -37,28 +39,24 @@
margin-right: 0;
margin-bottom: 0;
}
}
}

.features-wrapper-row-item {
img {
margin-right: 25px;
height: 62px;
width: 55px;
}

p {
margin: 0;
}
}
}

.features-wrapper-item {
&__title h1 {
&__title h3 {
width: 217px;
color: $grey-45;
font-size: 1rem;
letter-spacing: 0;
line-height: 30px;
font-weight: 600;
margin-top: 0;
margin-top: 16px;
}

&__description {
Expand All @@ -83,17 +81,17 @@
.features-wrapper {
&__item {
margin-bottom: 40px;

img {
margin-right: 32px;
height: 73px;
width: 65px;
}
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
img {
margin-right: 32px;
height: 73px;
width: 65px;
}

&__title h3 {
width: 518px;
font-size: 1.25rem;
}
Expand Down Expand Up @@ -121,20 +119,22 @@
justify-content: center;
align-items: baseline;
}
}

.features-wrapper-row {
&__item {
display: block;
margin-right: 98px;
text-align: center;

img {
margin-right: 0;
}
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
img {
margin-right: 0;
}

&__title h3 {
width: 200px;
font-size: 1.25rem;
}
Expand All @@ -156,20 +156,20 @@
}
}

.features-wrapper {
.features-wrapper-row {
&__item {
margin-right: 76px;
text-align: center;

img {
height: 73px;
width: 65px;
}
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
img {
height: 73px;
width: 65px;
}

&__title h3 {
width: 294px;
}

Expand Down
80 changes: 45 additions & 35 deletions assets/scss/components/slices/process.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
margin-bottom: 0;
}
}
}

.process-wrapper-row {
&__item {
display: flex;
align-items: center;
Expand All @@ -53,19 +55,15 @@
&:last-child {
margin-bottom: 0;
}

img {
height: 51px;
width: 51px;
}

p {
margin: 0;
}
}
}

.process-wrapper-item {
.process-wrapper-row-item {
img {
height: 51px;
width: 51px;
}

&__title h3 {
width: 175px;
color: $grey-45;
Expand All @@ -83,6 +81,10 @@
letter-spacing: 0.009rem;
line-height: 22px;
margin-left: 24px;

p {
margin: 0;
}
}
}

Expand All @@ -103,15 +105,19 @@
}
}

.process-wrapper__item {
margin-bottom: 40px;
.process-wrapper-row {
&__item {
margin-bottom: 40px;

div:first-of-type {
display: flex;
flex-direction: column;
align-items: center;
div:first-of-type {
display: flex;
flex-direction: column;
align-items: center;
}
}
}

.process-wrapper-row-item {
img {
margin-bottom: 24px;
}
Expand All @@ -138,7 +144,9 @@
justify-content: center;
align-items: baseline;
}
}

.process-wrapper-row {
&__item {
&:first-of-type {
margin-left: 56px;
Expand All @@ -149,14 +157,14 @@
margin-bottom: 0;
text-align: center;
height: 100%;

img {
margin-right: 0;
}
}
}

.process-wrapper-item {
.process-wrapper-row-item {
img {
margin-right: 0;
}

&__title h3 {
width: 245px;
font-size: 1.25rem;
Expand All @@ -172,16 +180,18 @@
}

@include device-is('large-screen') {
.process__wrapper {
padding: 0 98px 60px 98px;
width: 100%;
display: flex;
align-items: stretch;
flex-wrap: wrap;
justify-content: space-around;
.process {
&__wrapper {
padding: 0 98px 60px 98px;
width: 100%;
display: flex;
align-items: stretch;
flex-wrap: wrap;
justify-content: space-around;
}
}

.process-wrapper {
.process-wrapper-row {
&__item {
&:first-of-type {
margin-left: 0;
Expand All @@ -192,18 +202,18 @@
text-align: center;
height: 100%;

img {
height: 51px;
width: 51px;
}

&:last-of-type {
margin-right: 0;
}
}
}

.process-wrapper-item {
.process-wrapper-row-item {
img {
height: 51px;
width: 51px;
}

&__description {
margin-top: 8px;
width: 245px;
Expand Down
15 changes: 9 additions & 6 deletions assets/scss/components/slices/statistics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
margin-bottom: 0;
}
}
}

.statistics-wrapper-row {
&__item {
height: 196px;
width: 100%;
Expand All @@ -49,14 +51,11 @@
margin-right: 0;
margin-bottom: 32px;
}

p {
margin: 0;
}
}
}

.statistics-wrapper-item {
.statistics-wrapper-row-item {

&__title h3 {
width: 293px;
color: $grey-90;
Expand All @@ -76,6 +75,10 @@
letter-spacing: 0;
line-height: 32px;
margin-top: 5px;

p {
margin: 0;
}
}
}

Expand All @@ -99,7 +102,7 @@
}
}

.statistics-wrapper {
.statistics-wrapper-row {
&__item {
margin-bottom: 61px;
}
Expand Down
6 changes: 3 additions & 3 deletions components/slices/MultipleBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<div
v-for="(item, itemIndex) in itemsByRow"
:key="`item-${itemIndex}`"
:class="`${blockClass}-wrapper__item`"
:class="`${blockClass}-wrapper-row__item`"
>
<pix-image v-if="hasImage(item)" :field="item.item_image" />
<div>
<prismic-rich-text
:class="`${blockClass}-wrapper-item__title`"
:class="`${blockClass}-wrapper-row-item__title`"
:field="item.item_title"
/>
<prismic-rich-text
:class="`${blockClass}-wrapper-item__description`"
:class="`${blockClass}-wrapper-row-item__description`"
:field="item.item_description"
/>
</div>
Expand Down

0 comments on commit 20c3396

Please sign in to comment.