Skip to content

Commit

Permalink
Revert "format astro files"
Browse files Browse the repository at this point in the history
This reverts commit 8e00143.

Signed-off-by: Lorenzo Lewis <[email protected]>
  • Loading branch information
lorenzolewis committed Jul 24, 2023
1 parent 8e00143 commit c3a77c1
Show file tree
Hide file tree
Showing 40 changed files with 2,257 additions and 2,172 deletions.
70 changes: 35 additions & 35 deletions docs/src/components/about-astro.astro
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
---
interface Props {
title: string;
title: string;
}
const { title } = Astro.props;
---

<article class="flex not-content" aria-labelledby="about-astro-heading">
<small id="about-astro-heading">
{title}
<span class="sr-only">Astro</span>
</small>
<svg
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 301 79"
fill="var(--sl-color-white)"
>
<path
d="M20.8 66.8c-3.6-3.2-4.6-10-3.1-15 2.5 3.2 6.1 4.2 9.8 4.7 5.7.9 11.3.6 16.5-2l1.9-1.1a9 9 0 0 1 .4 4.3 12 12 0 0 1-5 8.5l-3.6 2.4c-3.6 2.4-4.6 5.3-3.2 9.4l.1.5c-1.8-.8-3.2-2-4.2-3.6-1-1.7-1.6-3.5-1.6-5.5 0-1 0-2-.2-3-.3-2.3-1.4-3.3-3.4-3.4a4 4 0 0 0-4.3 3.3l-.1.5ZM.5 51s10.5-5 21-5l8-24.6c.3-1.2 1.2-2 2.2-2 1 0 1.8.8 2.1 2l8 24.5c12.5 0 21 5.1 21 5.1L45 2.4C44.4.9 43.6 0 42.4 0H21c-1.2 0-2 1-2.6 2.4L.5 51Zm111-7c0 4.3-5.4 6.8-12.8 6.8-4.9 0-6.6-1.2-6.6-3.7 0-2.6 2.1-3.9 7-3.9 4.3 0 8 .1 12.4.6v.2Zm0-5.4a56 56 0 0 0-11.4-1c-14 0-20.5 3.4-20.5 11 0 8 4.5 11 14.9 11 8.8 0 14.7-2.2 17-7.6h.3l-.2 3.6c0 2.8.5 3 2.8 3h10.9c-.6-1.6-1-6.3-1-10.4l.2-12c0-9.1-5.4-14.8-22.4-14.8a83 83 0 0 0-21.7 3C81 27 82 32 82.3 35.2c5.3-2.5 13-3.6 18.8-3.6 8.2 0 10.4 1.9 10.4 5.6v1.5Zm29.8 7.9c-1.5.2-3.5.2-5.5.2-2.2 0-4.2-.1-5.6-.3V48c0 7.5 4.9 11.8 22 11.8 16.3 0 21.6-4.3 21.6-11.8 0-7.2-3.5-10.8-19-11.5-11.9-.6-13-1.9-13-3.4 0-1.7 1.6-2.6 9.6-2.6 8.3 0 10.6 1.1 10.6 3.5v.6a120.9 120.9 0 0 1 11 0l.1-1.4c0-8.8-7.3-11.7-21.5-11.7-15.9 0-21.3 4-21.3 11.5 0 6.8 4.3 11 19.6 11.7 11.3.4 12.5 1.6 12.5 3.4 0 1.8-1.8 2.7-9.7 2.7-9 0-11.4-1.3-11.4-3.9v-.3ZM193.2 15c-4.3 4-12 8-16.3 9v8.5l4 .1-.1 12.8c0 8 4.2 14 17.2 14 5.5 0 9.1-.7 13.7-1.6-.5-3-1-7.4-1.2-10.8-2.7.9-6.1 1.3-10 1.3-5.2 0-7.3-1.4-7.3-5.5v-10l17.5.2c0-3 0-7.6.2-10.6-5.7.2-12.1.2-17.4.2l.1-7.6h-.4Zm35.3 15.8.1-8.4h-11.8a752.4 752.4 0 0 1 0 36.2h13.5c-.2-3.5-.3-9.6-.3-14.7 0-8.1 3.3-10.5 10.8-10.5 3.5 0 6 .5 8.2 1.2 0-3 .6-9 1-11.6-2.3-.6-4.7-1-7.7-1-6.5-.1-11.2 2.5-13.4 8.8h-.4Zm59 9.5c0 6.5-4.7 9.6-12.1 9.6-7.4 0-12.1-2.9-12.1-9.6 0-6.7 4.8-9.2 12-9.2 7.4 0 12.2 2.7 12.2 9.2Zm12.3-.3c0-13-10.1-18.8-24.4-18.8-14.4 0-24.2 5.8-24.2 18.8s9.1 20 24.1 20c15.1 0 24.5-7 24.5-19.9Z"
>
</path>
</svg>
<slot />
<small id="about-astro-heading">
{title}
<span class="sr-only">Astro</span>
</small>
<svg
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 301 79"
fill="var(--sl-color-white)"
>
<path
d="M20.8 66.8c-3.6-3.2-4.6-10-3.1-15 2.5 3.2 6.1 4.2 9.8 4.7 5.7.9 11.3.6 16.5-2l1.9-1.1a9 9 0 0 1 .4 4.3 12 12 0 0 1-5 8.5l-3.6 2.4c-3.6 2.4-4.6 5.3-3.2 9.4l.1.5c-1.8-.8-3.2-2-4.2-3.6-1-1.7-1.6-3.5-1.6-5.5 0-1 0-2-.2-3-.3-2.3-1.4-3.3-3.4-3.4a4 4 0 0 0-4.3 3.3l-.1.5ZM.5 51s10.5-5 21-5l8-24.6c.3-1.2 1.2-2 2.2-2 1 0 1.8.8 2.1 2l8 24.5c12.5 0 21 5.1 21 5.1L45 2.4C44.4.9 43.6 0 42.4 0H21c-1.2 0-2 1-2.6 2.4L.5 51Zm111-7c0 4.3-5.4 6.8-12.8 6.8-4.9 0-6.6-1.2-6.6-3.7 0-2.6 2.1-3.9 7-3.9 4.3 0 8 .1 12.4.6v.2Zm0-5.4a56 56 0 0 0-11.4-1c-14 0-20.5 3.4-20.5 11 0 8 4.5 11 14.9 11 8.8 0 14.7-2.2 17-7.6h.3l-.2 3.6c0 2.8.5 3 2.8 3h10.9c-.6-1.6-1-6.3-1-10.4l.2-12c0-9.1-5.4-14.8-22.4-14.8a83 83 0 0 0-21.7 3C81 27 82 32 82.3 35.2c5.3-2.5 13-3.6 18.8-3.6 8.2 0 10.4 1.9 10.4 5.6v1.5Zm29.8 7.9c-1.5.2-3.5.2-5.5.2-2.2 0-4.2-.1-5.6-.3V48c0 7.5 4.9 11.8 22 11.8 16.3 0 21.6-4.3 21.6-11.8 0-7.2-3.5-10.8-19-11.5-11.9-.6-13-1.9-13-3.4 0-1.7 1.6-2.6 9.6-2.6 8.3 0 10.6 1.1 10.6 3.5v.6a120.9 120.9 0 0 1 11 0l.1-1.4c0-8.8-7.3-11.7-21.5-11.7-15.9 0-21.3 4-21.3 11.5 0 6.8 4.3 11 19.6 11.7 11.3.4 12.5 1.6 12.5 3.4 0 1.8-1.8 2.7-9.7 2.7-9 0-11.4-1.3-11.4-3.9v-.3ZM193.2 15c-4.3 4-12 8-16.3 9v8.5l4 .1-.1 12.8c0 8 4.2 14 17.2 14 5.5 0 9.1-.7 13.7-1.6-.5-3-1-7.4-1.2-10.8-2.7.9-6.1 1.3-10 1.3-5.2 0-7.3-1.4-7.3-5.5v-10l17.5.2c0-3 0-7.6.2-10.6-5.7.2-12.1.2-17.4.2l.1-7.6h-.4Zm35.3 15.8.1-8.4h-11.8a752.4 752.4 0 0 1 0 36.2h13.5c-.2-3.5-.3-9.6-.3-14.7 0-8.1 3.3-10.5 10.8-10.5 3.5 0 6 .5 8.2 1.2 0-3 .6-9 1-11.6-2.3-.6-4.7-1-7.7-1-6.5-.1-11.2 2.5-13.4 8.8h-.4Zm59 9.5c0 6.5-4.7 9.6-12.1 9.6-7.4 0-12.1-2.9-12.1-9.6 0-6.7 4.8-9.2 12-9.2 7.4 0 12.2 2.7 12.2 9.2Zm12.3-.3c0-13-10.1-18.8-24.4-18.8-14.4 0-24.2 5.8-24.2 18.8s9.1 20 24.1 20c15.1 0 24.5-7 24.5-19.9Z"
>
</path>
</svg>
<slot />
</article>

<style>
article {
max-width: 40rem;
margin-inline: auto;
padding-block: 5rem;
flex-direction: column;
align-items: center;
text-align: center;
gap: 0.5rem;
}
article > :global(*) {
max-width: 50ch;
}
small {
color: var(--sl-color-gray-3);
}
svg {
width: 15rem;
}
article {
max-width: 40rem;
margin-inline: auto;
padding-block: 5rem;
flex-direction: column;
align-items: center;
text-align: center;
gap: 0.5rem;
}
article > :global(*) {
max-width: 50ch;
}
small {
color: var(--sl-color-gray-3);
}
svg {
width: 15rem;
}
</style>
260 changes: 132 additions & 128 deletions docs/src/components/file-tree.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,140 +3,144 @@ import { fileTreeProcessor } from './internal/rehype-file-tree';
const content = await Astro.slots.render('default');
if (!/^\s*<ul>/.test(content)) {
throw new Error(
`<FileTree> component expects its content to be an unordered list but found HTML starting with “${content.slice(
0,
20
)}...”`
);
throw new Error(
`<FileTree> component expects its content to be an unordered list but found HTML starting with “${content.slice(
0,
20
)}...”`
);
}
const processedContent = await fileTreeProcessor.process({
value: content,
data: { directoryLabel: 'Directory' },
value: content,
data: { directoryLabel: 'Directory' },
});
---

<file-tree set:html={processedContent} class="not-content" data-pagefind-ignore />
<file-tree
set:html={processedContent}
class="not-content"
data-pagefind-ignore
/>

<style is:global>
file-tree {
--x-space: 1.5rem;
--y-pad: 0;

display: block;
border: 1px solid var(--sl-color-gray-5);
padding: 1rem;
background-color: var(--sl-color-gray-6);
font-size: var(--sl-text-xs);
font-family: var(--__sl-font-mono);
overflow-x: auto;
}

file-tree .directory > details,
file-tree .directory > details:hover,
file-tree .directory > details[open] {
border: 0;
padding: 0;
padding-inline-start: var(--x-space);
background: transparent;
}

file-tree .directory > details > summary,
file-tree .directory > details[open] > summary {
margin-inline-start: calc(-1 * var(--x-space));
border: 0;
padding: var(--y-pad) 0.625rem;
font-weight: normal;
color: var(--sl-color-white);
max-width: 100%;
}

file-tree .directory > details > summary::marker,
file-tree .directory > details > summary::-webkit-details-marker {
color: var(--sl-color-gray-3);
}

file-tree .directory > details > summary:hover .tree-icon,
file-tree .directory > details > summary:hover {
cursor: pointer;
color: var(--sl-color-text-accent);
fill: var(--sl-color-text-accent);
}

file-tree ul,
file-tree .directory > details ul {
margin-inline-start: 0.6875rem;
border-inline-start: 1px solid var(--sl-color-gray-5);
padding: 0;
padding-inline-start: 0.125rem;
list-style: none;
}

file-tree .directory > details > summary:hover ~ ul {
border-color: var(--sl-color-gray-4);
}

file-tree > ul {
margin: 0;
border: 0;
padding: 0;
}

file-tree li {
padding: var(--y-pad) 0;
}

file-tree .file {
margin-inline-start: calc(var(--x-space) - 0.125rem);
color: var(--sl-color-white);
}

file-tree .tree-entry {
display: inline-flex;
align-items: flex-start;
flex-wrap: wrap;
max-width: calc(100% - 1rem);
}
@media (min-width: 30em) {
file-tree .tree-entry {
flex-wrap: nowrap;
}
}

file-tree .tree-entry > :first-child {
flex-shrink: 0;
}

file-tree .empty {
color: var(--sl-color-gray-3);
padding-inline-start: 0.375rem;
}

file-tree .comment {
color: var(--sl-color-gray-3);
padding-inline-start: 1.625rem;
max-width: 24rem;
min-width: 12rem;
}

file-tree .highlight {
display: inline-block;
border-radius: 0.25rem;
padding-inline-end: 0.5rem;
color: var(--sl-color-text-invert);
background-color: var(--sl-color-text-accent);
}

file-tree svg.tree-icon {
display: inline;
fill: var(--sl-color-gray-3);
vertical-align: middle;
margin-inline: 0.125rem;
width: 1.25rem;
height: 1.25rem;
}
file-tree .highlight svg.tree-icon {
fill: var(--sl-color-text-invert);
}
file-tree {
--x-space: 1.5rem;
--y-pad: 0;

display: block;
border: 1px solid var(--sl-color-gray-5);
padding: 1rem;
background-color: var(--sl-color-gray-6);
font-size: var(--sl-text-xs);
font-family: var(--__sl-font-mono);
overflow-x: auto;
}

file-tree .directory > details,
file-tree .directory > details:hover,
file-tree .directory > details[open] {
border: 0;
padding: 0;
padding-inline-start: var(--x-space);
background: transparent;
}

file-tree .directory > details > summary,
file-tree .directory > details[open] > summary {
margin-inline-start: calc(-1 * var(--x-space));
border: 0;
padding: var(--y-pad) 0.625rem;
font-weight: normal;
color: var(--sl-color-white);
max-width: 100%;
}

file-tree .directory > details > summary::marker,
file-tree .directory > details > summary::-webkit-details-marker {
color: var(--sl-color-gray-3);
}

file-tree .directory > details > summary:hover .tree-icon,
file-tree .directory > details > summary:hover {
cursor: pointer;
color: var(--sl-color-text-accent);
fill: var(--sl-color-text-accent);
}

file-tree ul,
file-tree .directory > details ul {
margin-inline-start: 0.6875rem;
border-inline-start: 1px solid var(--sl-color-gray-5);
padding: 0;
padding-inline-start: 0.125rem;
list-style: none;
}

file-tree .directory > details > summary:hover ~ ul {
border-color: var(--sl-color-gray-4);
}

file-tree > ul {
margin: 0;
border: 0;
padding: 0;
}

file-tree li {
padding: var(--y-pad) 0;
}

file-tree .file {
margin-inline-start: calc(var(--x-space) - 0.125rem);
color: var(--sl-color-white);
}

file-tree .tree-entry {
display: inline-flex;
align-items: flex-start;
flex-wrap: wrap;
max-width: calc(100% - 1rem);
}
@media (min-width: 30em) {
file-tree .tree-entry {
flex-wrap: nowrap;
}
}

file-tree .tree-entry > :first-child {
flex-shrink: 0;
}

file-tree .empty {
color: var(--sl-color-gray-3);
padding-inline-start: 0.375rem;
}

file-tree .comment {
color: var(--sl-color-gray-3);
padding-inline-start: 1.625rem;
max-width: 24rem;
min-width: 12rem;
}

file-tree .highlight {
display: inline-block;
border-radius: 0.25rem;
padding-inline-end: 0.5rem;
color: var(--sl-color-text-invert);
background-color: var(--sl-color-text-accent);
}

file-tree svg.tree-icon {
display: inline;
fill: var(--sl-color-gray-3);
vertical-align: middle;
margin-inline: 0.125rem;
width: 1.25rem;
height: 1.25rem;
}
file-tree .highlight svg.tree-icon {
fill: var(--sl-color-text-invert);
}
</style>
Loading

0 comments on commit c3a77c1

Please sign in to comment.