Skip to content

Commit

Permalink
Merge pull request #561 from middlebury/560-pdf-links
Browse files Browse the repository at this point in the history
Add a PDF badge to links beginning with /media/. For #560.
  • Loading branch information
imcbride authored Nov 1, 2023
2 parents dd5ac09 + cb2545e commit c6eeed6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions src/scss/scope/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
a[href*='drive.google.com'],
a[href*='docs.google.com'],
a[href*='.pdf'],
a[href^='/media/'],
a[href*='middleburycollege-my.sharepoint.com'] {
&:after {
font-size: rem(10);
Expand Down Expand Up @@ -53,7 +54,8 @@
}
}

a[href*='.pdf'] {
a[href*='.pdf'],
a[href^='/media/'] {
&:after {
content: 'PDF';
}
Expand Down Expand Up @@ -95,7 +97,7 @@
}

ul {
> li {
>li {
position: relative;

&:before {
Expand All @@ -112,7 +114,7 @@
list-style-type: none;
counter-reset: ol;

> li {
>li {
counter-increment: ol;
position: relative;

Expand Down Expand Up @@ -160,8 +162,8 @@
// because @at-root seems to make the styles root for the entire list of selectors
// instead of the single selector it is used in front of.
// See https://stackoverflow.com/q/36902927/2193516
@at-root .paragraph--text + .paragraph--text > h2,
.lead + .paragraph--text > h2 {
@at-root .paragraph--text+.paragraph--text>h2,
.lead+.paragraph--text>h2 {
@include h2;
margin-top: $spacing-7;
margin-bottom: $spacing-4;
Expand Down Expand Up @@ -211,10 +213,10 @@
font-weight: $font-weight-semibold;
}

h6 > a,
h5 > a,
h4 > a,
h3 > a {
h6>a,
h5>a,
h4>a,
h3>a {
font-weight: 600;
}

Expand Down Expand Up @@ -252,6 +254,7 @@
}

.typography--sm {

li,
p {
font-size: $typescale-2;
Expand All @@ -260,4 +263,4 @@

.contains-links {
@include contains-links;
}
}
2 changes: 1 addition & 1 deletion src/templates/paragraphs/text.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maxime blanditiis dolor delectus eum mollitia commodi alias laborum <a href="https://docs.google.com/document/d/1iW2Kp8VU0k4sUSVtjeDe1HvRWejz9evf9jGeJPLD8FY/edit">google docs</a> expedita consequatur, odio numquam ullam accusantium ad. Deserunt facere sequi eum quasi?</p>

<p>Lorem ipsum, dolor sit amet <a href="https://drive.google.com">google drive</a> adipisicing elit. Maxime blanditiis dolor delectus eum mollitia commodi alias laborum <a href="https://www.middlebury.edu/schools-abroad/sites/www.middlebury.edu.schools-abroad/files/2019-05/discipline%20grid%202019-20.pdf?fv=-8tHe8Vn">pdf file link</a> expedita consequatur, odio numquam ullam accusantium ad. Deserunt facere sequi eum quasi?</p>
<p>Lorem ipsum, dolor sit amet <a href="https://drive.google.com">google drive</a> adipisicing elit. Maxime blanditiis dolor delectus eum mollitia commodi alias laborum <a href="https://www.middlebury.edu/schools-abroad/sites/www.middlebury.edu.schools-abroad/files/2019-05/discipline%20grid%202019-20.pdf?fv=-8tHe8Vn">pdf file link</a> expedita consequatur, odio numquam ullam accusantium ad. Deserunt facere sequi eum quasi? And another <a href="/media/12345">pdf file link</a>.</p>

<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maxime blanditiis dolor delectus eum mollitia commodi alias laborum <a href="https://middleburycollege-my.sharepoint.com/:w:/r/personal/zpykosz_middlebury_edu/_layouts/15/Doc.aspx?sourcedoc=%7BDBBAE29A-47B4-40CA-983A-9942E5FED5C9%7D&file=Document%201.docx&action=editnew&mobileredirect=true&wdTpl=TM00002138&wdNewAndOpenCt=1559232589076&wdPreviousSession=fd0d99b6-766a-403a-a81a-64c0a420f780&wdOrigin=ohpAppStartPages">office 365</a> expedita consequatur, odio numquam ullam accusantium ad. Deserunt facere sequi eum quasi?</p>

Expand Down

0 comments on commit c6eeed6

Please sign in to comment.