Skip to content

Commit

Permalink
chore(docs): description links are dark mode compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mdt2 committed Feb 15, 2024
1 parent 9ba2dfa commit cd93b99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion site/includes/exampleContent.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-
const withThemeCompatibleLinks = (markdown) => markdown.replace(/<a href/g, '<a class="spectrum-Link" href');
if example.description
.spectrum-Typography
section.spectrum-CSSExample-description.spectrum-Body.spectrum-Body--sizeM!= util.markdown.render(example.description)
section.spectrum-CSSExample-description.spectrum-Body.spectrum-Body--sizeM!= util.markdown.render(withThemeCompatibleLinks(example.description))

if example.details
.spectrum-Typography
Expand Down
7 changes: 5 additions & 2 deletions site/templates/siteComponent.pug
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
let status = dnaStatusTranslation[component.dnaStatus] || component.dnaStatus;
const withThemeCompatibleLinks = (markdown) => markdown.replace(/<a href/g, '<a class="spectrum-Link" href');
doctype html
html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
head
Expand Down Expand Up @@ -152,7 +155,7 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
section.spectrum-InLineAlert-content
p This component has been deprecated.
if component.deprecationNotice
span!= util.markdown.render(component.deprecationNotice)
span!= util.markdown.render(withThemeCompatibleLinks(component.deprecationNotice))

table.spectrum-CSSComponent-detailsTable
tr.spectrum-Body
Expand Down Expand Up @@ -219,7 +222,7 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
a(href="#usage").spectrum-BigSubtleLink Usage notes
hr.spectrum-Divider.spectrum-Divider--large
section.spectrum-CSSComponent-description
div.spectrum-Body.spectrum-Body--sizeM!= util.markdown.render(component.description)
div.spectrum-Body.spectrum-Body--sizeM!= util.markdown.render(withThemeCompatibleLinks(component.description))

if examples.length
header.spectrum-CSSComponent-sectionHeading(id="variants")
Expand Down

0 comments on commit cd93b99

Please sign in to comment.