Skip to content

Commit

Permalink
fix: APPS-2882 part 1: increase max-width of sectionTeaserCard & sect…
Browse files Browse the repository at this point in the history
…ionWrapper for ftva theme (#590)

* fix: set ftva max-widths to 1160px

* fix: refactor global sass to css vars

* fix: responsive behavior to spec

* fix: reduce min width

---------

Co-authored-by: Jess Divers <[email protected]>
  • Loading branch information
farosFreed and Jess Divers authored Aug 20, 2024
1 parent f8735e0 commit 6f7fd84
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 102 deletions.
89 changes: 2 additions & 87 deletions src/lib-components/SectionWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,91 +86,6 @@ const getId = computed(() => {
</template>

<style lang="scss" scoped>
.section-wrapper {
>.section-header {
margin-bottom: var(--space-xl);
>.section-title {
color: var(--color-primary-blue-03);
line-height: 1.2;
margin-bottom: var(--space-m);
}
.section-summary {
@include step-0;
padding-right: 0;
:deep(p:not(:last-child)) {
margin-bottom: var(--space-m);
}
:deep(p:last-child) {
margin: 0;
}
}
}
&.top-level {
--color-theme: var(--color-white);
&.theme-gray {
--color-theme: var(--color-secondary-grey-01);
padding: var(--space-2xl) var(--unit-gutter);
:deep(.byline-group) {
color: var(--color-secondary-grey-05);
}
}
&.theme-white {
padding: 0 var(--unit-gutter);
margin: var(--space-2xl) auto;
&.section-banner {
margin-top: 0;
>:deep(*) {
max-width: $container-xl-banner + px;
}
}
&.section-no-top-margin {
margin-top: 0;
}
.section-featured-banner {
max-width: $container-l-cta + px;
}
}
&.theme-divider {
padding: 0 var(--unit-gutter);
}
padding: var(--space-2xl) var(--unit-gutter);
margin: 0 auto;
background-color: var(--color-theme);
// Configure spacing of child components (individual components might override things like max-width)
>:deep(*) {
max-width: #{$container-l-main}px;
padding: 0;
margin-left: auto;
margin-right: auto;
&.block-call-to-action {
max-width: var(--block-width);
padding: var(--space-2xl);
}
}
> :first-child:not(.divider-way-finder) {
margin-top: 0;
}
> :last-child:not(.divider-way-finder) {
margin-bottom: 0;
}
}
}
@import "@/styles/default/_section-wrapper.scss";
@import "@/styles/ftva/_section-wrapper.scss";
</style>
87 changes: 87 additions & 0 deletions src/styles/default/_section-wrapper.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.section-wrapper {
>.section-header {
margin-bottom: var(--space-xl);

>.section-title {
color: var(--color-primary-blue-03);
line-height: 1.2;
margin-bottom: var(--space-m);
}

.section-summary {
@include step-0;
padding-right: 0;

:deep(p:not(:last-child)) {
margin-bottom: var(--space-m);
}

:deep(p:last-child) {
margin: 0;
}
}
}

&.top-level {
--color-theme: var(--color-white);

&.theme-gray {
--color-theme: var(--color-secondary-grey-01);
padding: var(--space-2xl) var(--unit-gutter);

:deep(.byline-group) {
color: var(--color-secondary-grey-05);
}
}

&.theme-white {
padding: 0 var(--unit-gutter);
margin: var(--space-2xl) auto;

&.section-banner {
margin-top: 0;

>:deep(*) {
max-width: $container-xl-banner + px;
}
}

&.section-no-top-margin {
margin-top: 0;
}

.section-featured-banner {
max-width: $container-l-cta + px;
}
}

&.theme-divider {
padding: 0 var(--unit-gutter);
}

padding: var(--space-2xl) var(--unit-gutter);
margin: 0 auto;
background-color: var(--color-theme);

// Configure spacing of child components (individual components might override things like max-width)
>:deep(*) {
max-width: #{$container-l-main}px;
padding: 0;
margin-left: auto;
margin-right: auto;

&.block-call-to-action {
max-width: var(--block-width);
padding: var(--space-2xl);
}
}

> :first-child:not(.divider-way-finder) {
margin-top: 0;
}

> :last-child:not(.divider-way-finder) {
margin-bottom: 0;
}
}
}
23 changes: 16 additions & 7 deletions src/styles/ftva/_block-card-with-image.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.ftva.block-highlight {
max-width: 350px;
height: 350px;
position: relative;

border-radius: 12px;
Expand All @@ -9,13 +7,24 @@
border-radius: 10px 10px 0 0;
}

.molecule-no-image {
border-radius: 10px 10px 0 0;
&.is-vertical {

.image-container {
aspect-ratio: 1.71 / 1;

.molecule-no-image {
border-radius: 10px 10px 0 0;
aspect-ratio: 1.67 / 1;
height: 100%;
}
}
}

:deep(.card-meta) {
margin: 25px 10px 0;
padding: 0px 10px 10px 10px;
position: relative;
margin: 0px;
padding: 25px 20px 15px 20px;
height: 191px;

.title {
@include ftva-card-title-2;
Expand Down Expand Up @@ -88,4 +97,4 @@
box-shadow: 0 4px 4px rgb(51 51 51 / 0.2);
}
}
}
}
2 changes: 1 addition & 1 deletion src/styles/ftva/_footer-links.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ftva.footer-links {
--unit-content-width: $ftva-container-max-width;
--unit-content-width: --ftva-container-max-width;
background-color: #191919;
color: white;

Expand Down
2 changes: 1 addition & 1 deletion src/styles/ftva/_footer-primary.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ftva.footer-primary {
--unit-content-width: $ftva-container-max-width;
--unit-content-width: --ftva-container-max-width;
background-color: $navy-blue;
border-bottom: 0px;

Expand Down
2 changes: 1 addition & 1 deletion src/styles/ftva/_footer-sock.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ftva.footer-sock {
--unit-content-width: $ftva-container-max-width;
--unit-content-width: --ftva-container-max-width;
background-color: #191919;

.container {
Expand Down
4 changes: 2 additions & 2 deletions src/styles/ftva/_section-teaser-card.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.ftva.section-teaser-card {
flex-wrap: nowrap;

max-width: 100%; // 100% of the parent container
align-items: flex-start;
overflow-y: auto;
padding-top: 25px;
scrollbar-color: $grey-blue $white;

.card {
width: calc((100% / 3) - 22px);
min-width: 298px;
min-width: 280px;
margin-bottom: 15px;

@media #{$medium} {
Expand Down
20 changes: 20 additions & 0 deletions src/styles/ftva/_section-wrapper.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.ftva.section-wrapper {
&.top-level {
&.theme-white {
&.section-banner {
>:deep(*) {
max-width: var(--ftva-container-max-width);
}
}

.section-featured-banner {
max-width: var(--ftva-container-max-width);
}
}

// FTVA uses different page max-width
>:deep(*) {
max-width: var(--ftva-container-max-width);
}
}
}
11 changes: 8 additions & 3 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

// Theme specific variables
// use css variables to make it easier to inject vars into storybook. etc
:root {
--ftva-container-max-width: 1160px;
--ftva-off-black: #191919;
--ftva-medium-blue: #41648C;
}

body {
font-family: var(--font-primary);
}
Expand All @@ -10,9 +18,6 @@ a {
@include animate-normal;
}

// Theme specific variables
$ftva-container-max-width: 1160px;

// Animations
.underline-hover {
position: relative;
Expand Down

1 comment on commit 6f7fd84

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.