Skip to content

Commit

Permalink
Fix Focus outline for 5.3.3 (#187)
Browse files Browse the repository at this point in the history
* Tweak Collapsible CSS
* Update CSS
  • Loading branch information
jason-fox authored Mar 9, 2024
1 parent 4828453 commit cf436b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
24 changes: 12 additions & 12 deletions Customization/xsl/nav.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@
<xsl:choose>
<xsl:when test="normalize-space(@href)">
<div>
<xsl:attribute name="class" select="'d-flex flex-row'"/>
<xsl:attribute name="class" select="'d-flex flex-row ps-0'"/>
<xsl:if test="exists($children)">
<xsl:attribute name="id" select="concat('menu-collapse-trigger-',$id)"/>
<!-- ↓ Add Toggle without text ↓ -->
<button data-bs-toggle="collapse">
<xsl:attribute name="class">
<xsl:text>btn d-inline-flex align-items-center pe-0 border-0</xsl:text>
<xsl:text>btn d-inline-flex align-items-center p-0 border-0</xsl:text>
<xsl:if test="$show-menu='show'">
<xsl:text> active</xsl:text>
</xsl:if>
Expand All @@ -760,7 +760,7 @@
</xsl:if>
<xsl:attribute name="aria-labelledby" select="concat('menu-collapse-trigger-',$id)"/>
<xsl:attribute name="aria-controls" select="concat('menu-collapse-',$id)"/>
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='16' viewBox='0 0 16 16'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'>
<path
fill='none'
stroke='currentColor'
Expand All @@ -770,6 +770,7 @@
d='M5 14l6-6-6-6'
/>
</svg>

</button>
</xsl:if>
<!-- ↓ Add Bootstrap classes to topic link ↓ -->
Expand All @@ -779,11 +780,10 @@
<xsl:with-param name="class">
<xsl:text>d-inline-flex align-items-center flex-shrink-1 </xsl:text>
<xsl:choose>
<xsl:when test="exists($children)">
<xsl:text>ps-1</xsl:text>
</xsl:when>
<xsl:when test="exists($children)"/>
<xsl:when test="count(ancestor::*/@href) eq 0"/>
<xsl:otherwise>
<xsl:text>ps-3</xsl:text>
<xsl:text>ps-2</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$active-class"/>
Expand All @@ -796,10 +796,10 @@
</xsl:when>
<xsl:otherwise>
<!-- ↓ Add Toggle with title text ↓ -->
<div class="d-flex flex-row">
<div class="d-flex flex-row ps-0">
<button data-bs-toggle="collapse">
<xsl:attribute name="class">
<xsl:text>btn d-inline-flex align-items-center pe-0 border-0</xsl:text>
<xsl:text>btn d-inline-flex align-items-center p-0 border-0</xsl:text>
<xsl:if test="$show-menu='show'">
<xsl:text> active</xsl:text>
</xsl:if>
Expand All @@ -809,7 +809,7 @@
<xsl:attribute name="aria-expanded" select="'true'"/>
<xsl:attribute name="aria-current" select="'true'"/>
</xsl:if>
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='16' viewBox='0 0 16 16'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'>
<path
fill='none'
stroke='currentColor'
Expand All @@ -822,7 +822,7 @@
</button>
<span data-bs-toggle="collapse">
<xsl:attribute name="class">
<xsl:text>d-inline-flex align-items-center flex-shrink-1 ps-1</xsl:text>
<xsl:text>d-inline-flex align-items-center flex-shrink-1 ps-2</xsl:text>
<xsl:if test="$show-menu='show'">
<xsl:text> active</xsl:text>
</xsl:if>
Expand All @@ -842,7 +842,7 @@
<xsl:if test="exists($children)">
<div>
<xsl:attribute name="id" select="concat('menu-collapse-',$id)"/>
<xsl:attribute name="class" select="concat('collapse ', $show-menu)"/>
<xsl:attribute name="class" select="concat('ps-2 collapse ', $show-menu)"/>
<ul class="list-unstyled fw-normal ps-4">
<xsl:apply-templates select="$children" mode="#current">
<xsl:with-param name="pathFromMaplist" select="$pathFromMaplist"/>
Expand Down
13 changes: 2 additions & 11 deletions css/collapsible-toc.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
.bd-links {
position: sticky;
display: block !important;

padding-left: 0.25rem;
margin-left: -0.25rem;
padding: 0 0.25rem;
}
}

Expand All @@ -63,20 +61,13 @@
}

.bd-links .btn {
padding-top: 0.25rem;
padding-bottom: 0;
padding-left: 0.25rem !important;
padding: 0.25rem !important;
font-weight: 600;
color: var(--bs-body-color);
background-color: transparent;
box-shadow: none;
}

[dir='rtl'] .bd-links .btn {
padding-right: 0.25rem !important;
padding-left: 0 !important;
}

.bd-links svg:hover {
color: var(--bs-link-hover-color);
}
Expand Down

0 comments on commit cf436b6

Please sign in to comment.