Skip to content

Commit

Permalink
Refactor css to use more specific rules rather than repeating selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlin committed Apr 28, 2022
1 parent 13e1ac1 commit fd58db1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
27 changes: 13 additions & 14 deletions js/src/get-started-page/features-card/index.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
@import "../_shared";

.gla-get-started-features-card {
// Adjust <CardHeader> imported from @wordpress/components.
// Repeat selector to make it higher priority.
.components-card__header.components-card__header {
flex-direction: column;
gap: $grid-unit-10;
padding: $grid-unit-60 $grid-unit * 14.125 $grid-unit-50;
text-align: center;

@media (max-width: $break-small) {
padding: $grid-unit-30 $grid-unit-30 $grid-unit-20;
gap: $grid-unit-20;
}
}

.components-flex {
gap: 50px;
padding: 0 $grid-unit * 11 $grid-unit-60;

// Adjust <CardHeader> imported from @wordpress/components.
&.components-card__header {
flex-direction: column;
gap: $grid-unit-10;
padding: $grid-unit-60 $grid-unit * 14.125 $grid-unit-50;
text-align: center;

@media (max-width: $break-small) {
padding: $grid-unit-30 $grid-unit-30 $grid-unit-20;
gap: $grid-unit-20;
}
}

&__block {
display: flex;
flex-direction: column;
Expand Down
43 changes: 22 additions & 21 deletions js/src/get-started-page/get-started-with-video-card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,31 @@
.gla-get-started-with-video-card {
flex-direction: column;

// Adjust <CardHeader> imported from @wordpress/components.
// Repeat selector to make it higher priority.
.components-card__header.components-card__header {
justify-content: flex-end;
padding: $grid-unit * 2.5;

& > p {
margin: 0 1em;
line-height: $line-height-smaller;
font-size: $helptext-font-size;
color: $gray-600;
}
.components-flex {
// Adjust <CardHeader> imported from @wordpress/components.
&.components-card__header {
justify-content: flex-end;
padding: $grid-unit * 2.5;

& > p {
margin: 0 1em;
line-height: $line-height-smaller;
font-size: $helptext-font-size;
color: $gray-600;
}

@media (max-width: $break-small) {
justify-content: center;
text-align: center;
padding: $grid-unit-20;
@media (max-width: $break-small) {
justify-content: center;
text-align: center;
padding: $grid-unit-20;

& > p::after {
content: " Google";
}
& > p::after {
content: " Google";
}

& > img {
display: none;
& > img {
display: none;
}
}
}
}
Expand Down

0 comments on commit fd58db1

Please sign in to comment.