Skip to content

Commit

Permalink
Remove white space in enum tables (#113)
Browse files Browse the repository at this point in the history
- Allow "tableFormat" css class to be used in other html elements that aren't div

Co-authored-by: cjsha <[email protected]>
  • Loading branch information
cjsha and cjsha authored Oct 28, 2024
1 parent 3a264e5 commit 7972f01
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 36 deletions.
19 changes: 8 additions & 11 deletions template/partials/enum.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
<h2>Fields</h2>

<table>

<tr>
<th style="white-space: no-wrap">Field & Value</th>
<th>Description</th>
</tr>

{{#oe.enum}}
<tr>
<td style="white-space: no-wrap">
<code>
{{{field&value}}}
</code>
</td>
<td>
{{{description}}}
</td>
<code>
{{{field&value}}}
</code>
</td>
<td class="tableFormat">
{{{description}}}
</td>
</tr>
{{/oe.enum}}

</table>
</table>
34 changes: 14 additions & 20 deletions template/partials/propertyTables.tmpl.partial
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
<tr>

<td style = "white-space: nowrap;">
<code>{{{name}}}</code>
</td>

<td style = "white-space: nowrap;">
{{{type}}}
</td>

<td>
<div class="tableFormat">
{{#propertyDescription}}
{{{propertyDescription.text}}}
{{#hasEnum}}
<table>
{{#enum}}
<tr>
<td class="term"><code>{{{field&value}}}</code></td>
<td class="description">{{{enumDescription}}}</td>
</tr>
{{/enum}}
</table>
{{/hasEnum}}
{{/propertyDescription}}
</div>
<td class="tableFormat">
{{#propertyDescription}}
{{{propertyDescription.text}}}
{{#hasEnum}}
<table>
{{#enum}}
<tr>
<td class="term"><code>{{{field&value}}}</code></td>
<td class="description">{{{enumDescription}}}</td>
</tr>
{{/enum}}
</table>
{{/hasEnum}}
{{/propertyDescription}}
</td>

</tr>
10 changes: 5 additions & 5 deletions template/public/main.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import "workflow.css";

div.tableFormat *:last-child {
.tableFormat *:last-child {
margin-bottom: 0;
}

div.tableFormat table {
.tableFormat table {
display: grid;
grid-template-columns: auto;
margin-top: 1rem;
Expand All @@ -14,20 +14,20 @@ div.tableFormat table {
border-collapse: collapse;
}

div.tableFormat td {
.tableFormat td {
padding: 0;
border: 0 hidden;
}

div.tableFormat td.term {
.tableFormat td.term {
/* !important tag prevents overrides from dotnet.css associated with:
body[data-yaml-mime="ManagedReference"] article td.term, body[data-yaml-mime="ApiPage"] article td.term
important tags are not good practice*/
font-weight: var(--bs-body-font-weight) !important;
white-space: nowrap;
}

div.tableFormat td.description {
.tableFormat td.description {
padding-left: 1rem;
}

Expand Down

0 comments on commit 7972f01

Please sign in to comment.