Skip to content

Commit

Permalink
docs: updated doc-site to work a little better on pages with little c…
Browse files Browse the repository at this point in the history
…ontent
  • Loading branch information
vycke committed Mar 12, 2024
1 parent d14e67f commit 62ef7e7
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 51 deletions.
4 changes: 3 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function getNavigation(collection) {
}

function getSubitems(collection, key) {
return collection.filter((c) => c.data.key === key).sort(sort("title"));
return collection
.filter((c) => c.data.key === key && c.data.subkey)
.sort(sort("title"));
}

module.exports = (config) => {
Expand Down
16 changes: 11 additions & 5 deletions public/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ article {
padding: var(--token-size-0);
max-width: 68ch;
}
footer {
padding: var(--token-size-0);
}

/* Main navigation */
nav {
Expand All @@ -52,24 +55,27 @@ nav a[data-selected="true"] {
font-weight: bold;
color: var(--token-neutral-5);
}
/* ensure text does not go on multiline in horizontal orientaiton */
nav li {
white-space: nowrap;
}

/* small changes for responsiveness */
@media (max-width: 785px) {
nav {
position: relative;
height: fit-content;
}
/* ensure main takes more space when there is very limited content */
main {
min-height: calc(100vh - 200px);
}

nav ul ul {
display: none;
}
}

/* ensure text does not go on multiline in horizontal orientaiton */
nav li {
white-space: nowrap;
}

/* Breadcrumbs */
.breadcrumbs {
color: var(--text-2);
Expand Down
2 changes: 1 addition & 1 deletion public/feo.min.css

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions site/_includes/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
<link rel="icon" href="/favicon.ico" sizes="any" />
</head>

<body>
<main class="sidebar --left --width-00 --gap-0 | flex-grow">
<!-- SIDEBAR -->
<body class="sidebar --left --width-00 --gap-0">
<!-- SIDEBAR -->
<nav class="flex-col items-center --gap-1">
<div class="flex-col --gap-none items-center">
{% include "svg/logo.svg" %}
Expand All @@ -41,15 +40,14 @@
</div>
{% include "partials/navigation.njk" %}
</nav>
<!-- This DIV is required to let layout patterns play nice with eachother -->
<div>
<article class="flex-col --gap-0 items-start">
{% include "partials/breadcrumb.njk" %}
<h1>{{title}}</h1>
{{ content | safe }}
{% include "partials/footer.njk" %}
</article>
</div>
<!-- CONTENT -->
<main class="repel --column">
<article class="flex-col --gap-0 items-start">
{% include "partials/breadcrumb.njk" %}
<h1>{{title}}</h1>
{{ content | safe }}
</article>
{% include "partials/footer.njk" %}
</main>
</body>
</html>
2 changes: 1 addition & 1 deletion site/_includes/partials/footer.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- FOOTER -->
<footer class="cluster --gap-000 justify-start | size-00 italic | mt-1">
<footer class="cluster --gap-000 justify-end | size-00 italic">
<span>Powered by: <a href="https://11ty.dev" class="italic">11ty</a> & Feo.css</span>
<span>|</span>
<a href="https://github.com/vyckes/feo-css">Github</a>
Expand Down
2 changes: 0 additions & 2 deletions site/blocks/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@ overwritten to control the looks of the table. You can change these properties o
</tbody>
</table>
</div>

[_Back to components overview_](/components)
2 changes: 0 additions & 2 deletions site/blocks/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,3 @@ overwritten to control the looks of the table. You can change these properties o
</tbody>
</table>
</div>

[_Back to components overview_](/components)
2 changes: 0 additions & 2 deletions site/blocks/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,3 @@ overwritten to control the looks of the table. You can change these properties o
</tbody>
</table>
</div>

[_Back to components overview_](/components)
2 changes: 0 additions & 2 deletions site/blocks/toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ as you will put the label text after the toggle in most cases. You can change th
</tbody>
</table>
</div>

[_Back to components overview_](/components)
2 changes: 0 additions & 2 deletions site/blocks/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ There are several custom properties available that can be overwritten to control
</tbody>
</table>
</div>

[_Back to components overview_](/components)
2 changes: 0 additions & 2 deletions site/layouts/center.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ Places the targeted element in the horizontal center. It takes the entire availa
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ determines how many items can be on a single row (e.g. tag cloud).
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/flexbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@ Although not really a layout pattern, Feo.css adds a set of classes to control f
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ A layout pattern to easily create a grid of equal columns.
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/pancake.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ A common vertical pattern where the center content should stretch the available
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
5 changes: 2 additions & 3 deletions site/layouts/repel.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ key: layouts
subkey: repel
---

A simple layout pattern that pushes elements away from eachother, given the available space. Effectively implementing the `.justify-between`, `.--gap-{z}` and `.flex-row` classes.
A simple layout pattern that pushes elements away from eachother, given the available space. Effectively implementing the `.justify-between`, `.--gap-{z}` and `.flex-row` (as the default is horizontal orientation) classes.

{% include "svg/repel.njk" %}

Expand All @@ -26,8 +26,7 @@ A simple layout pattern that pushes elements away from eachother, given the avai
</thead>
<tbody>
<tr><td><code>--gap-{z}</code></td><td>Controls the gap between the child elements</td></tr>
<tr><td><code>--column</code></td><td>Sets the direction to vertical, default is horizontal</td></tr>
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ A common responsive layout in which there is a "sidebar" of a _fixed_ width, and
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ A simple layout pattern to place items on top eachother, in a depth sense. The l
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/switcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ A _responsive_ layout pattern that helps switching the orientation from horizont
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)
2 changes: 0 additions & 2 deletions site/layouts/tiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ Also known as a RAM (repeat, auto, minmax) layout. It is a tile system in which
</tbody>
</table>
</div>

[_Back to layouts overview_](/layouts)

0 comments on commit 62ef7e7

Please sign in to comment.