-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from hlxsites/471-nhtsa-accordion-styling
Changes for NHTSA
- Loading branch information
Showing
11 changed files
with
594 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
export default function decorate(block) { | ||
const cols = [...block.firstElementChild.children]; | ||
block.classList.add(`columns-${cols.length}-cols`); | ||
|
||
// Add target blank for nhtsa contact section link to open in new tab | ||
if (block.classList.contains('nhtsa')) { | ||
[...block.querySelectorAll('a')].forEach((link) => { | ||
if (!link.target) { | ||
link.target = '_blank'; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
:root { | ||
--nhtsa-header-gutter: 16px; | ||
} | ||
|
||
.nhtsa-header { | ||
display: flex; | ||
gap: var(--nhtsa-header-gutter); | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.nhtsa-header .icon-nova-bus svg, | ||
.nhtsa-header .icon-prevost svg, | ||
.nhtsa-header .icon-logo svg { | ||
width: 100px; | ||
height: 20px; | ||
} | ||
|
||
.nhtsa-header .nhsta-header__langauge-switch { | ||
background-color: var(--c-cta-blue-default); | ||
color: var(--c-white); | ||
text-transform: uppercase; | ||
padding: 9px 21px; | ||
font-family: var(--font-family-body); | ||
font-size: var(--f-button-font-size); | ||
line-height: var(--f-button-line-height); | ||
letter-spacing: var(--f-button-letter-spacing); | ||
border: 0; | ||
align-items: center; | ||
display: flex; | ||
text-decoration: none; | ||
border-radius: 4px; | ||
} | ||
|
||
.nhtsa-header .nhsta-header__langauge-switch:hover, | ||
.nhtsa-header .nhsta-header__langauge-switch:focus { | ||
background-color: var(--c-cta-blue-hover); | ||
} | ||
|
||
.nhtsa-header .nhsta-header__langauge-switch:active { | ||
background-color: var(--c-cta-blue-active); | ||
} | ||
|
||
.nhtsa-header .hide { | ||
display: none; | ||
} | ||
|
||
@media (min-width: 1200px) { | ||
:root { | ||
--nhtsa-header-gutter: 32px; | ||
} | ||
|
||
.nhtsa-header-wrapper { | ||
border-top: 1px solid var(--c-grey-300); | ||
} | ||
|
||
.nhtsa-header .icon-logo svg { | ||
width: 160px; | ||
height: 30px; | ||
} | ||
|
||
.nhtsa-header .icon-nova-bus svg, | ||
.nhtsa-header .icon-prevost svg { | ||
width: initial; | ||
height: initial; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { unwrapDivs } from '../../scripts/common.js'; | ||
|
||
// hide buttons for, content if they are from same origin | ||
function hideButtons(buttons) { | ||
buttons.forEach((element) => { | ||
element.classList.add('button', 'nhsta-header__langauge-switch'); | ||
const url = element.href; | ||
const { location: { origin } = {} } = window.location.origin; | ||
|
||
if (origin === url) { | ||
element.classList.add('hide'); | ||
} | ||
}); | ||
} | ||
|
||
export default async function decorate(block) { | ||
unwrapDivs(block); | ||
const anchorTags = block.querySelectorAll('a'); | ||
hideButtons(anchorTags); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
:root { | ||
--label-top: -6px; | ||
} | ||
|
||
.vin-number__form { | ||
display: flex; | ||
gap: 8px; | ||
flex-direction: column; | ||
} | ||
|
||
.vin-number__input-wrapper { | ||
position: relative; | ||
} | ||
|
||
.vin-number__input { | ||
margin: 0; | ||
max-width: 100%; | ||
} | ||
|
||
.redesign-v2 .vin-number__form .vin-number__submit { | ||
max-width: 100%; | ||
} | ||
|
||
.vin-number__form .vin-number__submit:disabled { | ||
background-color: var(--overlay-background-color); | ||
cursor: unset; | ||
} | ||
|
||
.vin-number__label { | ||
left: var(--input-padding); | ||
pointer-events: none; | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
transition: | ||
top var(--duration-small) var(--easing-standard), | ||
left var(--duration-small) var(--easing-standard); | ||
} | ||
|
||
.vin-number__input:focus ~ .vin-number__label, | ||
.vin-number__input:not(:placeholder-shown) ~ .vin-number__label, | ||
.vin-number__input:not(:focus):valid ~ .v2-forms__label { | ||
bottom: 0; | ||
left: 0; | ||
top: var(--label-top); | ||
} | ||
|
||
/* recalls list styling */ | ||
.vin-number__results-container{ | ||
padding: 20px 0; | ||
} | ||
|
||
.vin-number__recalls-wrapper { | ||
margin-top: 40px; | ||
} | ||
|
||
.vin-number__recalls-heading-wrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
margin-bottom: 5px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.vin-number__recalls-heading { | ||
margin-bottom: 0; | ||
} | ||
|
||
.vin-number__list, | ||
.vin-number__detail-list { | ||
list-style: none; | ||
} | ||
|
||
.vin-number__list-item { | ||
border-top: 1px solid var(--c-black); | ||
padding: 20px 0; | ||
} | ||
|
||
.vin-number__detail-item { | ||
display: flex; | ||
gap: 16px; | ||
} | ||
|
||
.vin-number__detail-item--column { | ||
flex-direction: column; | ||
gap: 0; | ||
} | ||
|
||
.vin-number__detail-item:not(:first-child){ | ||
margin-top: 10px; | ||
} | ||
|
||
.vin-number__recall-incomplete, | ||
.vin-number__recall-incomplete-no-remedy { | ||
color: var(--c-error-red); | ||
} | ||
|
||
.vin-number__recall-complete { | ||
color: var(--c-leaf-4); | ||
} | ||
|
||
@media (min-width: 744px) { | ||
:root { | ||
--label-top: 3px; | ||
} | ||
|
||
.vin-number__form { | ||
flex-direction: row; | ||
max-width: 100%; | ||
} | ||
|
||
.vin-number__input-wrapper { | ||
flex: 1; | ||
} | ||
} |
Oops, something went wrong.