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 380a5fe commit 4dd063e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 34 deletions.
22 changes: 13 additions & 9 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 @@ -50,8 +52,8 @@
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
&__title h3 {
width: 217px;
color: $grey-45;
font-size: 1rem;
Expand Down Expand Up @@ -92,8 +94,8 @@
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
&__title h3 {
width: 518px;
font-size: 1.25rem;
}
Expand Down Expand Up @@ -121,7 +123,9 @@
justify-content: center;
align-items: baseline;
}
}

.features-wrapper-row {
&__item {
display: block;
margin-right: 98px;
Expand All @@ -133,8 +137,8 @@
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
&__title h3 {
width: 200px;
font-size: 1.25rem;
}
Expand All @@ -156,7 +160,7 @@
}
}

.features-wrapper {
.features-wrapper-row {
&__item {
margin-right: 76px;
text-align: center;
Expand All @@ -168,8 +172,8 @@
}
}

.features-wrapper-item {
&__title h1 {
.features-wrapper-row-item {
&__title h3 {
width: 294px;
}

Expand Down
48 changes: 28 additions & 20 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 @@ -65,7 +67,7 @@
}
}

.process-wrapper-item {
.process-wrapper-row-item {
&__title h3 {
width: 175px;
color: $grey-45;
Expand Down Expand Up @@ -103,17 +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;
}

img {
margin-bottom: 24px;
img {
margin-bottom: 24px;
}
}
}
}
Expand All @@ -138,7 +142,9 @@
justify-content: center;
align-items: baseline;
}
}

.process-wrapper-row {
&__item {
&:first-of-type {
margin-left: 56px;
Expand All @@ -156,7 +162,7 @@
}
}

.process-wrapper-item {
.process-wrapper-row-item {
&__title h3 {
width: 245px;
font-size: 1.25rem;
Expand All @@ -172,16 +178,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 @@ -203,7 +211,7 @@
}
}

.process-wrapper-item {
.process-wrapper-row-item {
&__description {
margin-top: 8px;
width: 245px;
Expand Down
6 changes: 4 additions & 2 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 @@ -56,7 +58,7 @@
}
}

.statistics-wrapper-item {
.statistics-wrapper-row-item {
&__title h3 {
width: 293px;
color: $grey-90;
Expand Down Expand Up @@ -99,7 +101,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 4dd063e

Please sign in to comment.