From fd58db19226381a86e70564384878da364922b8f Mon Sep 17 00:00:00 2001 From: Ian Yu-Hsun Lin Date: Thu, 28 Apr 2022 15:27:53 +0800 Subject: [PATCH] Refactor css to use more specific rules rather than repeating selectors --- .../get-started-page/features-card/index.scss | 27 ++++++------ .../get-started-with-video-card/index.scss | 43 ++++++++++--------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/js/src/get-started-page/features-card/index.scss b/js/src/get-started-page/features-card/index.scss index e6d91c7ea6..7af44270b1 100644 --- a/js/src/get-started-page/features-card/index.scss +++ b/js/src/get-started-page/features-card/index.scss @@ -1,24 +1,23 @@ @import "../_shared"; .gla-get-started-features-card { - // Adjust 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 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; diff --git a/js/src/get-started-page/get-started-with-video-card/index.scss b/js/src/get-started-page/get-started-with-video-card/index.scss index 267a1ab828..fa04a6e2a3 100644 --- a/js/src/get-started-page/get-started-with-video-card/index.scss +++ b/js/src/get-started-page/get-started-with-video-card/index.scss @@ -3,30 +3,31 @@ .gla-get-started-with-video-card { flex-direction: column; - // Adjust 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 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; + } } } }