Skip to content

Commit

Permalink
adding js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulaBannerman committed Jan 6, 2025
1 parent 6322171 commit 9831146
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
29 changes: 29 additions & 0 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,33 @@

.margin-top{
margin-top: 2rem !important;
}




.external-link::after {
background-image: url('../images/icons/external-link.svg');
margin-left: 4px;
background-position: 50% 60%;
background-repeat: no-repeat;
background-size: 100%;
content: "";
display: inline;
margin-left: 5px;
padding-left: .65em;
}

#ogp-identifier.usa-identifier .external-link::after,
.usa-button.external-link::after,
.usa-nav__submenu-item .external-link::after {
background-image: url('../images/icons/launch--white.png');
margin-left: 4px;
background-position: 50% 60%;
background-repeat: no-repeat;
background-size: 100%;
content: "";
display: inline;
margin-left: 5px;
padding-left: .65em;
}
11 changes: 11 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// Add your custom javascript here
console.log("Hi from Federalist");


document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('a');
links.forEach(link => {
const url = new URL(link.href);
if (url.origin !== window.location.origin && !link.querySelector('img')) {
link.classList.add('external-link');
link.setAttribute('target', '_blank');
}
});
});

0 comments on commit 9831146

Please sign in to comment.