Skip to content

Commit

Permalink
WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
daveverwer committed Jul 9, 2023
1 parent 6604869 commit cec9740
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
27 changes: 21 additions & 6 deletions FrontEnd/styles/package_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,22 @@
// -------------------------------------------------------------------------

#package-list {
display: grid;
gap: 5px;
display: flex;
flex-direction: column;
gap: 10px;
padding: 0;
list-style: none;

> li {
display: flex;
flex-direction: row;
justify-content: space-between;
background-color: var(--package-list-background);
border-left: 3px var(--package-list-border) solid;

a {
a.package-link {
display: block;
flex-grow: 1;
align-items: center;
padding: 10px;

Expand Down Expand Up @@ -80,10 +85,20 @@
li.stars::before {
background-image: var(--image-stars);
}
}

a.documentation-link {
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
background-position: center calc(50% - 20px);
background-repeat: no-repeat;
background-size: 20px;
background-image: var(--image-documentation);

li.has-documentation::before {
background-size: 84%;
background-image: var(--image-documentation);
div {
margin-top: 20px;
}
}

Expand Down
18 changes: 10 additions & 8 deletions Sources/App/Views/Plot+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ extension Node where Context == HTML.ListContext {
hasDocs: Bool) -> Self {
.li(
.a(
.class("package-link"),
.href(linkUrl),
.h4(.text(packageName)),
.unwrap(summary) { .p(.text($0)) },
Expand Down Expand Up @@ -286,15 +287,16 @@ extension Node where Context == HTML.ListContext {
},
.unwrap(stars) {
.starsListItem(numberOfStars: $0)
},
.if (hasDocs,
.li(.class("has-documentation"),
.small(
.text("Has documentation")
)
)
)
}
)
),
.if (hasDocs,
.a(
.class("documentation-link"),
.div(
.text("Documentation")
)
)
)
)
}
Expand Down

0 comments on commit cec9740

Please sign in to comment.