Skip to content

Commit 57fbd1f

Browse files
committed
chore: improve styling patterns
1 parent d72b926 commit 57fbd1f

10 files changed

Lines changed: 37 additions & 53 deletions

.changeset/rich-eggs-burn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuzdev/fuz_gitops': minor
3+
---
4+
5+
chore: improve styling patterns

src/lib/ModulesDetail.svelte

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// TODO add favicon (from library? gro?)
3434
</script>
3535

36-
<div class="modules_detail">
37-
<div class="nav_wrapper">
36+
<div class="modules-detail">
37+
<div class="nav-wrapper">
3838
<section>
3939
<ModulesNav {repos_modules} />
4040
</section>
@@ -43,7 +43,7 @@
4343
<ul class="width_atmost_md box unstyled">
4444
{#each repos_modules as repo_modules (repo_modules)}
4545
{@const {repo, modules} = repo_modules}
46-
<li class="repo_module">
46+
<li class="repo-module">
4747
<header class="width:100% position:relative">
4848
<a href="#{repo.name}" id={repo.name} class="subtitle">🔗</a>
4949
<a href={resolve(`/tree/${repo.repo_name}`)}>{repo.name}</a>
@@ -58,7 +58,7 @@
5858
class:css={path.endsWith('.css')}
5959
class:json={path.endsWith('.json')}
6060
>
61-
<div class="module_file">
61+
<div class="module-file">
6262
{#if repo.repo_url}
6363
<div class="chip row">
6464
<!-- TODO this is a hack that could be fixed by adding an optional `base: './'` that defaults to './src/lib/' -->
@@ -76,7 +76,7 @@
7676
<ul class="declarations unstyled">
7777
{#each declarations as { name, kind } (name)}
7878
{#if name !== 'default'}
79-
<li class="declaration chip {kind}_declaration">
79+
<li class="declaration chip {kind}-declaration">
8080
{name}
8181
</li>
8282
{/if}
@@ -94,7 +94,7 @@
9494
<!-- TODO better rendering, also show author, etc -->
9595

9696
<style>
97-
.modules_detail {
97+
.modules-detail {
9898
position: relative;
9999
padding: var(--space_lg);
100100
display: flex;
@@ -109,13 +109,13 @@
109109
top: 0;
110110
text-align: right;
111111
}
112-
.repo_module {
112+
.repo-module {
113113
width: 100%;
114114
display: flex;
115115
flex-direction: column;
116116
margin-bottom: var(--space_xl5);
117117
}
118-
.repo_module > header {
118+
.repo-module > header {
119119
display: flex;
120120
padding: var(--space_xs) var(--space_md);
121121
font-size: var(--font_size_lg);
@@ -130,7 +130,7 @@
130130
margin-bottom: var(--space_lg);
131131
--link_color: var(--text_70);
132132
}
133-
.module_file {
133+
.module-file {
134134
margin-bottom: var(--space_xs);
135135
}
136136
.ts {
@@ -159,20 +159,20 @@
159159
font-family: var(--font_family_mono);
160160
font-size: var(--font_size_sm);
161161
}
162-
.variable_declaration {
162+
.variable-declaration {
163163
color: var(--color_d_50);
164164
}
165-
.function_declaration {
165+
.function-declaration {
166166
color: var(--color_c_50);
167167
}
168-
.type_declaration {
168+
.type-declaration {
169169
color: var(--color_g_50);
170170
}
171-
.class_declaration {
171+
.class-declaration {
172172
color: var(--color_f_50);
173173
}
174174
/* TODO extract */
175-
.nav_wrapper {
175+
.nav-wrapper {
176176
position: sticky;
177177
top: var(--space_xl);
178178
display: flex;

src/lib/ModulesNav.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// TODO add favicon (from library? gro?)
1818
</script>
1919

20-
<nav class="modules_nav">
20+
<nav class="modules-nav">
2121
<h6>packages</h6>
2222
<ul class="unstyled">
2323
{#each repos_modules as pkg_modules (pkg_modules)}
@@ -31,7 +31,7 @@
3131
</nav>
3232

3333
<style>
34-
.modules_nav {
34+
.modules-nav {
3535
width: 100%;
3636
}
3737
h6 {

src/lib/ReposTable.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
deps.map((dep) => {
3939
const repo = repos.find((repo) => repo.package_json.name === dep);
4040
if (!repo?.package_json) return [dep, null];
41-
return [dep, repo.package_json.version];
41+
return [dep, repo.package_json.version ?? null];
4242
}),
4343
),
4444
);

src/lib/ReposTree.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
} = $props();
2020
</script>
2121

22-
<div class="repos_tree">
22+
<div class="repos-tree">
2323
<ReposTreeNav {repos} {selected_repo}>
2424
{@render nav()}
2525
</ReposTreeNav>
2626
{#if selected_repo}
27-
<section class="detail_wrapper">
27+
<section class="detail-wrapper">
2828
<div class="panel detail p_md">
2929
<LibraryDetail library={selected_repo.library} />
3030
</div>
@@ -36,7 +36,7 @@
3636
{#if repo.package_json}
3737
<LibrarySummary library={repo.library}>
3838
{#snippet repo_name(repo_name)}
39-
<a href={resolve(`/tree/${repo_name}`)} class="repo_name">{repo_name}</a>
39+
<a href={resolve(`/tree/${repo_name}`)} class="repo-name">{repo_name}</a>
4040
{/snippet}
4141
</LibrarySummary>
4242
{:else}
@@ -56,7 +56,7 @@
5656
</div>
5757

5858
<style>
59-
.repos_tree {
59+
.repos-tree {
6060
width: 100%;
6161
display: flex;
6262
flex-direction: row;
@@ -74,13 +74,13 @@
7474
.summaries li {
7575
margin-bottom: var(--space_xl);
7676
}
77-
.repo_name {
77+
.repo-name {
7878
font-size: var(--font_size_xl2);
7979
font-weight: 500;
8080
text-align: center;
8181
margin-bottom: var(--space_xl);
8282
}
83-
.detail_wrapper {
83+
.detail-wrapper {
8484
padding: var(--space_lg);
8585
width: 100%;
8686
}

src/lib/TablePage.svelte

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<title>table {repo.package_json.glyph} {repo.package_json.name}</title>
1818
</svelte:head>
1919

20-
<main class="box">
20+
<main class="box mx_auto">
2121
<div class="p_lg">
2222
<PageHeader {repo} />
2323
</div>
@@ -32,12 +32,6 @@
3232
</main>
3333

3434
<style>
35-
main {
36-
display: flex;
37-
flex-direction: column;
38-
align-items: center;
39-
margin: 0 auto;
40-
}
4135
section {
4236
margin-bottom: var(--space_xl4);
4337
}

src/lib/TreeItemPage.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{/if}
3939
<ReposTree {repos} selected_repo={route_repo}>
4040
{#snippet nav()}
41-
<div class="repos_tree_nav">
41+
<div class="repos-tree-nav">
4242
<Breadcrumb>{repo.package_json.glyph}</Breadcrumb>
4343
</div>
4444
{/snippet}
@@ -66,12 +66,12 @@
6666
align-items: center;
6767
width: 100%;
6868
}
69-
.repos_tree_nav {
69+
.repos-tree-nav {
7070
display: flex;
7171
margin-top: var(--space_xl);
7272
}
7373
/* TODO hacky */
74-
.repos_tree_nav :global(.breadcrumb) {
74+
.repos-tree-nav :global(.breadcrumb) {
7575
justify-content: flex-start;
7676
}
7777
</style>

src/lib/TreePage.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<section class="tree">
2929
<ReposTree {repos}>
3030
{#snippet nav()}
31-
<div class="repos_tree_nav">
31+
<div class="repos-tree-nav">
3232
<Breadcrumb>{repo.package_json.glyph}</Breadcrumb>
3333
</div>
3434
{/snippet}
@@ -54,12 +54,12 @@
5454
flex-direction: row;
5555
align-items: flex-start;
5656
}
57-
.repos_tree_nav {
57+
.repos-tree-nav {
5858
display: flex;
5959
margin-top: var(--space_xl);
6060
}
6161
/* TODO hacky */
62-
.repos_tree_nav :global(.breadcrumb) {
62+
.repos-tree-nav :global(.breadcrumb) {
6363
justify-content: flex-start;
6464
}
6565
</style>

src/routes/+page.svelte

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<title>{library.package_json.name}</title>
1414
</svelte:head>
1515

16-
<main class="box">
16+
<main class="box mx_auto">
1717
<section style:margin-top="var(--docs_primary_nav_height, 60px)">
1818
<MainHeader />
1919
</section>
@@ -47,12 +47,6 @@
4747
</main>
4848

4949
<style>
50-
main {
51-
display: flex;
52-
flex-direction: column;
53-
align-items: center;
54-
margin: 0 auto;
55-
}
5650
menu {
5751
gap: var(--space_lg);
5852
width: 100%;

src/routes/about/+page.svelte

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<title>about {library.package_json.glyph} {library.package_json.name}</title>
1414
</svelte:head>
1515

16-
<main class="width_atmost_md">
16+
<main class="width_atmost_md box mx_auto">
1717
<div class="p_lg">
1818
<PageHeader repo={library}></PageHeader>
1919
</div>
@@ -25,12 +25,3 @@
2525
</section>
2626
<PageFooter />
2727
</main>
28-
29-
<style>
30-
main {
31-
display: flex;
32-
flex-direction: column;
33-
align-items: center;
34-
margin: 0 auto;
35-
}
36-
</style>

0 commit comments

Comments
 (0)