Skip to content

Commit

Permalink
All custom links floats right
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Jul 16, 2024
1 parent be559ef commit e600f8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 31 deletions.
22 changes: 13 additions & 9 deletions assets/uts-overrides.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,35 @@
<xsl:if test="../f:addr=/f:tree/f:frontmatter/f:addr">
<xsl:choose>
<xsl:when test="../f:taxon[text()='Person']">
<a class="slug-source" href="https://github.com/utensil/forest/blob/main/trees/people/{../f:addr}.tree">
<xsl:text>[source]</xsl:text>
<a class="link-source" href="https://github.com/utensil/forest/blob/main/trees/people/{../f:addr}.tree">
<xsl:text>✍️</xsl:text>
<span>source</span>
</a>
</xsl:when>
<xsl:when test="../f:taxon[text()='Reference']">
<a class="slug-source" href="https://github.com/utensil/forest/blob/main/trees/refs/{../f:addr}.tree">
<xsl:text>[source]</xsl:text>
<a class="link-source" href="https://github.com/utensil/forest/blob/main/trees/refs/{../f:addr}.tree">
<xsl:text>✍️</xsl:text>
<span>source</span>
</a>
</xsl:when>
<xsl:when test="../f:taxon[text()='Proof']">
<a class="slug-source" href="https://github.com/utensil/forest/blob/main/trees/{../../f:backmatter/f:context/f:tree/f:frontmatter/f:addr}.tree">
<xsl:text>[source]</xsl:text>
<a class="link-source" href="https://github.com/utensil/forest/blob/main/trees/{../../f:backmatter/f:context/f:tree/f:frontmatter/f:addr}.tree">
<xsl:text>✍️</xsl:text>
<span>source</span>
</a>
</xsl:when>
<xsl:otherwise>
<a class="slug-source" href="https://github.com/utensil/forest/blob/main/trees/{../f:addr}.tree">
<xsl:text>[source]</xsl:text>
<a class="link-source" href="https://github.com/utensil/forest/blob/main/trees/{../f:addr}.tree">
<xsl:text>✍️</xsl:text>
<span>source</span>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- uts-end -->
<!-- uts-begin -->
<xsl:if test="../f:meta[@name='pdf']">
<a target="_blank" class="link-pdf" href="{../f:addr}.pdf">📄<span> PDF</span></a>
<a target="_blank" class="link-pdf" href="{../f:addr}.pdf">📄<span>PDF</span></a>
</xsl:if>
<xsl:if test="../f:meta[@name='lean']">
<xsl:apply-templates select="../f:meta[@name='lean']" />
Expand Down
32 changes: 10 additions & 22 deletions assets/uts-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ body {
margin-right: auto;
}

#grid-wrapper article {
max-width: 100%;
}

#grid-wrapper nav#toc {
display: none;
}
Expand Down Expand Up @@ -116,13 +120,6 @@ nav#toc a.slug {
text-decoration-style: unset !important; */
}

a.slug-source {
text-decoration-line: underline;
text-decoration-style: dotted;
color: var(--uts-text-gentle) !important;
font-weight: normal;
}

/* This applies to references, including in title, main text, backmatter, but not in toc */
.link-reference a
{
Expand Down Expand Up @@ -416,9 +413,9 @@ nav#toc li.active {
display: table;
} */

.link-pdf {
.link-source, .link-pdf, .meta-lean a, .meta-lean-symbol {
font-weight: normal;
font-size: 80%;
font-size: 60%;
border-radius: 5px;
color: var(--uts-text-gentle) !important;
background-color: var(--uts-background) !important;
Expand All @@ -429,26 +426,17 @@ nav#toc li.active {
float: right;
}

.link-pdf span {
.link-source span, .link-pdf span {
display: none;
margin-left: 1ex;
}

.link-pdf:hover span {
.link-source:hover span, .link-pdf:hover span {
display: inline;
}

.meta-lean a, .meta-lean-symbol {
font-weight: normal;
.meta-lean a, .meta-lean-symbol, .link-source span, .link-pdf span {
font-family: Fira Code, DejaVu Sans Mono, monospace;
font-size: 60%;
border-radius: 5px;
color: var(--uts-text-gentle) !important;
background-color: var(--uts-background) !important;
border: var(--uts-text-gentle) 1px solid;
padding: 3px 1ex 3px 1ex;
margin: 0 0.5ex 1ex 0.5ex;
cursor: pointer;
float: right;
}

/* details:hover > summary .meta-lean a {
Expand Down

0 comments on commit e600f8a

Please sign in to comment.