Update SDG header component

* Add a header element as component markup wrapper
* Allow component to receive an optional block
* Add reusable styles for header links

Co-autored-by: Javi Martín <javim@elretirao.net>
This commit is contained in:
Senén Rodero Rodríguez
2020-11-24 18:05:44 +01:00
parent 88bcf527d8
commit 3364423698
3 changed files with 29 additions and 2 deletions

View File

@@ -614,6 +614,16 @@ code {
}
}
.admin-content > header {
align-items: flex-start;
display: flex;
a {
@include hollow-button;
margin-left: auto;
}
}
.admin-content .select-geozone,
.admin-content .select-heading {

View File

@@ -198,3 +198,14 @@
transform: translateX(-50%);
}
}
@mixin hollow-button($color: $link) {
@include button($style: hollow, $background: $color);
font-size: $base-font-size;
margin-bottom: 0;
&:focus,
&:hover {
text-decoration: none;
}
}

View File

@@ -1,11 +1,17 @@
module SDGManagement::Header
extend ActiveSupport::Concern
def header
def header(&block)
provide(:title) do
"#{t("sdg_management.header.title")} - #{title}"
end
tag.h2 title
tag.header do
if block_given?
tag.h2(title) + capture(&block)
else
tag.h2(title)
end
end
end
end