diff --git a/FrontEnd/styles/package_list.scss b/FrontEnd/styles/package_list.scss index 804318a51e..4fbc5f0a65 100644 --- a/FrontEnd/styles/package_list.scss +++ b/FrontEnd/styles/package_list.scss @@ -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; @@ -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; } } diff --git a/Sources/App/Views/Plot+Extensions.swift b/Sources/App/Views/Plot+Extensions.swift index 73898a32f1..c8fce97907 100644 --- a/Sources/App/Views/Plot+Extensions.swift +++ b/Sources/App/Views/Plot+Extensions.swift @@ -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)) }, @@ -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") + ) + ) ) ) }