Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #768 from GSA/757-update-footer-styles
Browse files Browse the repository at this point in the history
757 update footer styles
  • Loading branch information
scottqueen-bixal authored May 2, 2023
2 parents c18703d + 2da5cd7 commit 9afd7b2
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 52 deletions.
6 changes: 3 additions & 3 deletions assets/styles/theme/_uswds-theme-color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ $theme-text-reverse-color: "white";

// Links
$theme-link-color: "primary";
$theme-link-visited-color: "violet-70v";
$theme-link-visited-color: "violet-60v";
$theme-link-hover-color: "primary-darker";
$theme-link-active-color: "primary-darker";
$theme-link-active-color: "blue-warm-70v";
$theme-link-reverse-color: "base-lighter";
$theme-link-reverse-hover-color: "base-lightest";
$theme-link-reverse-active-color: "white";
$theme-link-reverse-active-color: "white";
74 changes: 60 additions & 14 deletions assets/styles/theme/_uswds-theme-usagov.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ $AZ-button-disabled: #859cba;
}

.usa-footer {
// more specified styles to align with parent web property usa.gov
&__primary-section {
@include u-bg("gray-cool-10");
}
Expand All @@ -118,25 +119,69 @@ $AZ-button-disabled: #859cba;
text-decoration: none;
}

.usa-list--unstyled > li {
@include u-margin-bottom(1);
&__contact-links {
margin-top: 0;
}

&__primary-content {
@include at-media(mobile-lg) {
@include u-border-top(1px, "solid", "base-light");
}
&__contact-heading {
margin-bottom: .5rem;
}

@include at-media(tablet) {
border: 0;
#bottom-phone {
p,
a {
font-size: 17.6px;
}
}
}

.usa-footer--big .usa-footer__primary-content--collapsible .usa-list--unstyled {
@include at-media-max("tablet") {
@include u-padding-x(2);
@include u-padding-y(2);
.usa-footer--big .usa-footer__primary-section {
// more specified styles to align with parent web property usa.gov
h3 {
margin-top: 0;
}

.usa-list--unstyled {
padding-bottom: 2rem;
padding-top: .75rem;
margin-top: 1rem;

.usa-footer__secondary-link {
margin-bottom: 0;
}
}
// this keeps links aligned because title lengths are different
@include at-media(desktop) {
#col-2,
#col-4 {
> li:first-of-type {
padding-top: 22.4px;
}
}
}

.usa-accordion {
&__content{
background-color: initial;
}

&__button {
background-color: #efefef;
font-size: 19.2px;
padding: 16px 16px 16px 40px;
}

&__button[aria-expanded=false],
&__button[aria-expanded=true] {
background-image: url("../../assets/img/usa-icons/navigate_next.svg");
background-position: left 1rem center;
background-size: 20px;
}

&__button[aria-expanded=true] {
background-image: url("../../assets/img/usa-icons/expand_more.svg");
text-decoration: underline;
}
}
}

Expand All @@ -146,6 +191,7 @@ $AZ-button-disabled: #859cba;
.usa-button {
background-color: color("cyan-30v");
color: $black;
border: 1px $black solid;

&:hover {
background-color: #00a6d2;
Expand Down Expand Up @@ -196,7 +242,6 @@ h1.text-secondary {
}

.usa-gov-footer__primary-link {
min-height: units(6);
font-size: size("ui", 7);
}

Expand All @@ -205,10 +250,11 @@ h1.text-secondary {
}

.usa-sign-up {
@include u-padding-top(5);
@include u-padding-top(3);
}

.usa-identifier__section {
text-align: center;
@include u-padding-bottom(0);
}

Expand Down
5 changes: 2 additions & 3 deletions components/BetaUsaGovFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- Lower contact info block. -->
<div class="usa-footer__secondary-section">
<div class="grid-container">
<div class="grid-container padding-bottom-4">
<div class="grid-row grid-gap">
<div class="usa-footer__logo grid-row mobile-lg:grid-col-6 mobile-lg:grid-gap-2">
<span id="bottom-phone">
Expand All @@ -30,12 +30,11 @@
</div>

<div class="mobile-lg:grid-col-auto">
<p class="margin-bottom-0">{{ $t("footer.GroupTwo.subHeader") }}</p>
<p>{{ $t("footer.GroupTwo.subHeader") }}</p>

<address class="usa-footer__address">
<div class="usa-footer__contact-info">
<a
class="margin-bottom-3"
:href="sanitizedBearsUrl($t('footer.GroupOne.linkOneUrl'))">
{{ $t("footer.GroupTwo.linkOne") }}
</a>
Expand Down
56 changes: 30 additions & 26 deletions components/BetaUsaGovFooterNav.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="grid-row grid-gap-4">
<div
:class="match_isNarrowPlus ? '' : 'footer-nav-accordion-wrap'"
class="tablet:grid-col-6 desktop:grid-col-3">
:class="match_isNarrowMedium ? '' : 'footer-nav-accordion-wrap'"
class="mobile-lg:grid-col-6 desktop:grid-col-3">
<section
:class="match_isNarrowPlus ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
:class="match_isNarrowMedium ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
class="usa-footer__primary-content">
<!-- footer nav column 1.-->
<h3 :class="match_isNarrowPlus ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowPlus">{{ $t("beta.footer.column1Title") }}</span>
<h3 :class="match_isNarrowMedium ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowMedium">{{ $t("beta.footer.column1Title") }}</span>
<button
v-else
type="button"
Expand All @@ -21,7 +21,7 @@

<ul
id="col-1"
:class="match_isNarrowPlus ? '' : 'usa-accordion__content'"
:class="match_isNarrowMedium ? '' : 'usa-accordion__content'"
class="usa-list usa-list--unstyled">
<li
v-for="item in $t('beta.footer.column1')"
Expand All @@ -35,14 +35,14 @@
</div>

<div
:class="match_isNarrowPlus ? '' : 'footer-nav-accordion-wrap'"
class="tablet:grid-col-6 desktop:grid-col-3">
:class="match_isNarrowMedium ? '' : 'footer-nav-accordion-wrap'"
class="mobile-lg:grid-col-6 desktop:grid-col-3">
<section
:class="match_isNarrowPlus ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
:class="match_isNarrowMedium ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
class="usa-footer__primary-content">
<!-- footer nav column 2.-->
<h3 :class="match_isNarrowPlus ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowPlus">{{ $t("beta.footer.column2Title") }}</span>
<h3 :class="match_isNarrowMedium ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowMedium">{{ $t("beta.footer.column2Title") }}</span>
<button
v-else
type="button"
Expand All @@ -55,7 +55,7 @@

<ul
id="col-2"
:class="match_isNarrowPlus ? '' : 'usa-accordion__content'"
:class="match_isNarrowMedium ? '' : 'usa-accordion__content'"
class="usa-list usa-list--unstyled">
<li
v-for="item in $t('beta.footer.column2')"
Expand All @@ -69,14 +69,14 @@
</div>

<div
:class="match_isNarrowPlus ? '' : 'footer-nav-accordion-wrap'"
class="tablet:grid-col-6 desktop:grid-col-3">
:class="match_isNarrowMedium ? '' : 'footer-nav-accordion-wrap'"
class="mobile-lg:grid-col-6 desktop:grid-col-3">
<section
:class="match_isNarrowPlus ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
:class="match_isNarrowMedium ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
class="usa-footer__primary-content">
<!-- footer nav column 3.-->
<h3 :class="match_isNarrowPlus ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowPlus">{{ $t("beta.footer.column3Title") }}</span>
<h3 :class="match_isNarrowMedium ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowMedium">{{ $t("beta.footer.column3Title") }}</span>
<button
v-else
type="button"
Expand All @@ -89,7 +89,7 @@

<ul
id="col-3"
:class="match_isNarrowPlus ? '' : 'usa-accordion__content'"
:class="match_isNarrowMedium ? '' : 'usa-accordion__content'"
class="usa-list usa-list--unstyled">
<li
v-for="item in $t('beta.footer.column3')"
Expand All @@ -103,14 +103,14 @@
</div>

<div
:class="match_isNarrowPlus ? '' : 'footer-nav-accordion-wrap'"
class="tablet:grid-col-6 desktop:grid-col-3">
:class="match_isNarrowMedium ? '' : 'footer-nav-accordion-wrap'"
class="mobile-lg:grid-col-6 desktop:grid-col-3">
<section
:class="match_isNarrowPlus ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
:class="match_isNarrowMedium ? '' : 'usa-footer__primary-content--collapsible usa-accordion'"
class="usa-footer__primary-content">
<!-- footer nav column 4.-->
<h3 :class="match_isNarrowPlus ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowPlus">{{ $t("beta.footer.column4Title") }}</span>
<h3 :class="match_isNarrowMedium ? 'usa-gov-footer__primary-link' : 'usa-accordion__heading'">
<span v-if="match_isNarrowMedium">{{ $t("beta.footer.column4Title") }}</span>
<button
v-else
type="button"
Expand All @@ -123,7 +123,7 @@

<ul
id="col-4"
:class="match_isNarrowPlus ? '' : 'usa-accordion__content'"
:class="match_isNarrowMedium ? '' : 'usa-accordion__content'"
class="usa-list usa-list--unstyled">
<li
v-for="item in $t('beta.footer.column4')"
Expand All @@ -148,7 +148,11 @@ export default {
name: "BetaUsaGovFooterNav",
// Register the MatchMedia mixin with the queries we want plus optional names.
mixins: [sanitizeUrl, FooterAccordion, MatchMedia("narrow", "isNarrow"), MatchMedia("narrowPlus", "isNarrowPlus")],
mixins: [
sanitizeUrl,
FooterAccordion,
MatchMedia("narrowMedium", "isNarrowMedium"),
],
methods: {
sanitizedBearsUrl(benefitUrl, defaultValue = "#") {
Expand All @@ -160,4 +164,4 @@ export default {
},
},
}
</script>
</script>
4 changes: 2 additions & 2 deletions locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@
"linkTwoUrl": "https://usa.gov/espanol/contactenos"
},
"GroupThree": {
"header": "Sign Up to Receive Email Updates",
"header": "Sign up to receive email updates",
"formLabel": "Enter your email",
"buttonText": "Sign Up"
},
"subFooterLabel": "USAGov tagline",
"subFooter": "USAGov is the Official Guide to Government Information and Services"
"subFooter": "USAGov is the official guide to government information and services"
},
"crossSell": {
"title": "Other benefits that might be relevant to you."
Expand Down
8 changes: 4 additions & 4 deletions mixins/FooterAccordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export default {
// Loop through each accordion wrap.
accordionWrap.forEach((item) => {
// Define the media query.
const mq640 = window.matchMedia("(min-width: 640px)")
const mq480 = window.matchMedia("(min-width: 480px)")
// Add a Listener.
mq640.addListener(WidthChange640)
mq480.addListener(WidthChange640)
// Define the width change.
WidthChange640(mq640)
WidthChange640(mq480)
// Media query change function for width specific functions.
function WidthChange640(mq) {
// Define the accordion content within.
const accordionContent = item.querySelector(".usa-list")
if (mq640.matches) {
if (mq480.matches) {
// If wider than 640px.
accordionContent.removeAttribute("hidden")
} else {
Expand Down
1 change: 1 addition & 0 deletions mixins/MatchMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const theme = {
screens: {
narrow: "320px",
narrowMedium: "480px",
narrowPlus: "640px",
medium: "768px",
mediumPlus: "840px",
Expand Down

0 comments on commit 9afd7b2

Please sign in to comment.