From 9365663fd16a0209fcd4ff07ad96e634f448be3d Mon Sep 17 00:00:00 2001 From: Carlos Gauci Date: Thu, 19 Dec 2024 16:19:57 +0000 Subject: [PATCH] add solution button --- .../assets/sass/components/_buttons.scss | 16 ++++++++++++++++ .../layouts/partials/advent-challenge.html | 5 +++++ .../haystack/layouts/partials/arrow-button.html | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/themes/haystack/assets/sass/components/_buttons.scss b/themes/haystack/assets/sass/components/_buttons.scss index a0cfce52..80344b4e 100644 --- a/themes/haystack/assets/sass/components/_buttons.scss +++ b/themes/haystack/assets/sass/components/_buttons.scss @@ -147,6 +147,22 @@ button.nav-toggle-close { ); } } + + &.btn-yellow { + background-color: rgba($color: #{var(--color-yellow-rgb)}, $alpha: 1); + color: var(--color-white); + + svg { + fill: var(--color-white); + } + + &:hover { + background-color: rgba( + $color: #{var(--color-yellow-rgb)}, + $alpha: 0.9 + ); + } + } } // Arrow buttons diff --git a/themes/haystack/layouts/partials/advent-challenge.html b/themes/haystack/layouts/partials/advent-challenge.html index 293bfe84..e3d83f5e 100644 --- a/themes/haystack/layouts/partials/advent-challenge.html +++ b/themes/haystack/layouts/partials/advent-challenge.html @@ -11,6 +11,11 @@ {{ partial "arrow-button" (dict "context" . "type" "link" "text" "Submit" "url" . "color" "green" "icon" "submit")}} {{ end }} + + {{ if .Params.solution }} + {{ partial "arrow-button" (dict "context" . "type" "link" "text" "Solution" "url" .Params.solution_url "color" "yellow" "icon" + "star")}} + {{ end }}
diff --git a/themes/haystack/layouts/partials/arrow-button.html b/themes/haystack/layouts/partials/arrow-button.html index 0d976706..6aa9b8e9 100644 --- a/themes/haystack/layouts/partials/arrow-button.html +++ b/themes/haystack/layouts/partials/arrow-button.html @@ -37,6 +37,10 @@ {{ end }} + {{ if eq . "star" }} + + {{ end }} + {{ end }}
{{ .text }}