Skip to content

Commit

Permalink
Merge pull request #105 from jason-fox/feature/spacing
Browse files Browse the repository at this point in the history
Fix #104 - add defined button padding to collapsible sidebar
  • Loading branch information
infotexture authored Aug 31, 2023
2 parents cbd8b20 + edb8dbc commit 13a2ecd
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 4 deletions.
13 changes: 12 additions & 1 deletion Customization/xsl/nav.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<xsl:param name="FILEDIR" as="xs:string?"/>
<xsl:param name="FILENAME" as="xs:string?"/>
<xsl:param name="BOOTSTRAP_CSS_ACTIVE_NAV_PARENT" select="'active'"/>
<xsl:param name="TOC_SPACER_PADDING" select="'0'"/>
<xsl:param name="input.map.url" as="xs:string?"/>

<xsl:variable name="input.map" as="document-node()?">
Expand Down Expand Up @@ -255,7 +256,17 @@
<xsl:call-template name="sidebar-content"/>
</xsl:when>
<xsl:otherwise>
<div class="bs-sidebar">
<div>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="not($TOC_SPACER_PADDING = '0')">
<xsl:value-of select="concat('bs-sidebar py-', $TOC_SPACER_PADDING)"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>bs-sidebar</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:call-template name="offcanvas-sidebar"/>
</div>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions Customization/xsl/utility-classes.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
exclude-result-prefixes="xs dita-ot"
>
<xsl:param name="BOOTSTRAP_CSS_SHORTDESC" select="'text-body-secondary lead'"/>
<xsl:param name="BOOTSTRAP_CSS_CODEBLOCK" select="'border rounded'"/>
<xsl:param name="BOOTSTRAP_CSS_CODEBLOCK" select="'alert alert-secondary'"/>
<xsl:param name="BOOTSTRAP_CSS_TOPIC_TITLE" select="''"/>
<xsl:param name="BOOTSTRAP_CSS_SECTION_TITLE" select="'h4'"/>
<xsl:param name="BOOTSTRAP_CSS_CARD" select="''"/>
<xsl:param name="BOOTSTRAP_CSS_CAROUSEL" select="''"/>
<xsl:param name="BOOTSTRAP_CSS_CAPTION" select="'bg-secondary-subtle text-body-secondary'"/>
<xsl:param name="BOOTSTRAP_CSS_CAPTION" select="'alert alert-secondary p-1'"/>
<xsl:param name="BOOTSTRAP_CSS_TABS" select="''"/>
<xsl:param name="BOOTSTRAP_CSS_TABS_VERTICAL" select="'me-3'"/>
<xsl:param name="BOOTSTRAP_CSS_ACCORDION" select="''"/>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ Additionally, opt-in breadcrumbs and menu bars can be added using the following
- `args.breadcrumbs` – add Bootstrap breadcrumb components
- `menubar-toc.include` – add a Bootstrap menubar
- `scrollspy-toc` – add a Bootstrap [scrollspy][18] navigator
- `bidi.include` - whether to force included support for RTL languages
- `bidi.include` – whether to force included support for RTL languages
- `toc-spacer.padding` – specifies the vertical padding to add to the side menu

## Feedback

Expand Down
19 changes: 19 additions & 0 deletions build_dita2html5-bootstrap_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@
<equals arg1="${bootstrap.theme}" arg2="none"/>
</condition>

<condition property="toc-spacer.padding" value="1">
<or>
<equals arg1="${bootstrap.theme}" arg2="darkly"/>
<equals arg1="${bootstrap.theme}" arg2="flatly"/>
<equals arg1="${bootstrap.theme}" arg2="materia"/>
<equals arg1="${bootstrap.theme}" arg2="pulse"/>
<equals arg1="${bootstrap.theme}" arg2="quartz"/>
<equals arg1="${bootstrap.theme}" arg2="sketchy"/>
</or>
</condition>
<condition property="toc-spacer.padding" value="3">
<or>
<equals arg1="${bootstrap.theme}" arg2="lux"/>
</or>
</condition>

<copy
file="${bootstrap.template.file}"
toFile="${bootstrap.theme.file}"
Expand All @@ -239,5 +255,8 @@
value="${bootstrap.theme}/bootstrap${bootstrap.rtl}min.css "
/>
<property name="args.hdf" value="${bootstrap.theme.file}"/>
<property
file="${dita.plugin.net.infotexture.dita-bootstrap.dir}/cfg/${bootstrap.theme}.properties"
/>
</target>
</project>
1 change: 1 addition & 0 deletions cfg/cosmo.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bootstrap.css.figure.image=img-fluid border
1 change: 1 addition & 0 deletions cfg/lux.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bootstrap.css.figure.image=img-fluid border
3 changes: 3 additions & 0 deletions cfg/morph.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bootstrap.css.carousel=border rounded border-secondary-subtle shadow pt-3 pb-2 px-1
bootstrap.css.carousel.indicators=border rounded-5 border-secondary-subtle bg-secondary p-1 shadow
bootstrap.css.figure.image=img-fluid border rounded shadow
2 changes: 2 additions & 0 deletions cfg/pulse.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bootstrap.css.carousel=border border-primary-subtle pt-3 pb-2 px-1
bootstrap.css.figure.image=img-fluid border
1 change: 1 addition & 0 deletions cfg/yeti.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bootstrap.css.figure.image=img-fluid border
34 changes: 34 additions & 0 deletions css/collapsible-toc.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,51 @@

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

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

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

.bd-links .ps-2 {
padding-left: 0.5rem !important;
}

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

.bd-links .ps-3 {
padding-left: 0.75rem !important;
}

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

.bd-links .ps-4 {
padding-left: 1rem !important;
}

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

[dir='rtl'] .bd-links svg {
transform: rotate(180deg);
}
Expand Down
5 changes: 5 additions & 0 deletions insertParameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
expression="${bidi.include}"
if:set="bidi.include"
/>
<param
name="TOC_SPACER_PADDING"
expression="${toc-spacer.padding}"
if:set="toc-spacer.padding"
/>
<param
name="BOOTSTRAP_ICON_TIP"
expression="${bootstrap.icon.tip}"
Expand Down
12 changes: 12 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
<val>yes</val>
<val default="true">no</val>
</param>
<param
name="toc-spacer.padding"
desc="Specifies the vertical padding to add to the side menu"
type="enum"
>
<val default="true">0</val>
<val>1</val>
<val>2</val>
<val>3</val>
<val>4</val>
<val>5</val>
</param>
<param
name="popovers.include"
desc="Specifies whether to enable popovers and tooltips"
Expand Down
5 changes: 5 additions & 0 deletions sample/index.dita
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@
<indexterm><parmname>--icons.include</parmname></indexterm>
<indexterm><parmname>--popovers.include</parmname></indexterm>
<indexterm><parmname>--dark.mode.include</parmname></indexterm>
<indexterm><parmname>--menubar-toc.include</parmname></indexterm>
<indexterm><parmname>--bidi.include</parmname></indexterm>
<indexterm><parmname>--toc-spacer.padding</parmname></indexterm>
<p>Bootstrap <xref href="./icons.dita" format="dita">icons</xref>,
<xref href="./popovers.dita" format="dita">popovers</xref>,
<xref href="./tooltips.dita" format="dita">tooltips</xref> and the <xref
Expand Down Expand Up @@ -482,6 +485,8 @@
<li>
<parmname>--bidi.include</parmname> – whether to force included support for
<xref href="./rtl.dita" format="dita">RTL languages</xref></li>
<li>
<parmname>--toc-spacer.padding</parmname> – specifies the vertical padding to add to the side menu</li>
</ul>
</section>
</body>
Expand Down

0 comments on commit 13a2ecd

Please sign in to comment.