attachments: align style with notice #28

This commit is contained in:
Sören Weber 2021-07-17 11:58:28 +02:00
parent 565cfbe03d
commit 919c826f8c
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 45 additions and 41 deletions

View file

@ -1,9 +1,8 @@
{{ $_hugo_config := `{ "version": 1 }` }} {{ $_hugo_config := `{ "version": 1 }` }}
<section class="attachments {{ with .Get "style"}}{{.}}{{ end }}"> {{ $style := .Get "style" | default "neutral" }}
<label> {{ $title := .Get "title" | default ("Attachments-label" | T) }}
<i class="fas fa-paperclip" aria-hidden="true"></i> <section class="attachments {{ $style }}">
{{with .Get "title"}}{{.}}{{else}}{{T "Attachments-label"}}{{end}} <div class="label">{{ $title }}</div>
</label>
{{if eq .Page.File.BaseFileName "index"}} {{if eq .Page.File.BaseFileName "index"}}
{{$.Scratch.Add "filesName" "files"}} {{$.Scratch.Add "filesName" "files"}}
{{else}} {{else}}
@ -33,4 +32,3 @@
</div> </div>
{{.Inner}} {{.Inner}}
</section> </section>

View file

@ -531,65 +531,71 @@ div.notices.tip > div.label:first-child:before {
/* attachments shortcode */ /* attachments shortcode */
section.attachments { section.attachments {
border-top-width: 2rem;
border-top-style: solid;
color: #505050;
margin: 2rem 0; margin: 2rem 0;
position: relative; padding-left: 1rem;
padding-right: 1rem;
padding-bottom: .1px;
} }
section.attachments label { section.attachments > div.label {
font-weight: 400; color: #fff;
padding-left: 0.5em; font-weight: normal;
padding-top: 0.2em; margin-bottom: 1rem;
padding-bottom: 0.2em; margin-top: -1.75rem;
margin: 0; }
section.attachments > div.label:first-child:before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
margin-left: -.35rem;
margin-right: .35rem;
content: "\f0c6";
} }
section.attachments .attachments-files { section.attachments .attachments-files {
padding: 15px; padding: 1rem;
display: block; display: block;
font-size: 1rem; font-size: 1rem;
margin-top: 0rem; margin-top: -1rem;
margin-bottom: 0rem; margin-bottom: 0rem;
color: #666;
} }
section.attachments.orange label { section.attachments.orange {
color: #fff; border-color: #BF8B44;
background: #F0B37E; background-color: #FFF2DB;
} }
section.attachments.orange .attachments-files { section.attachments.green {
background: #FFF2DB; border-color: #5AA55A;
background-color: #E6F9E6;
} }
section.attachments.green label { section.attachments.red {
color: #fff; border-color: #D96A68;
background: rgba(92, 184, 92, 0.8); background-color: #FFEBEB;
} }
section.attachments.green .attachments-files { section.attachments.blue {
background: #E6F9E6; border-color: #4897CC;
background-color: #E9F5FD;
} }
section.attachments.blue label { section.attachments.grey {
color: #fff; border-color: #505D65;
background: #6AB0DE; background-color: #F4F4F4;
} }
section.attachments.blue .attachments-files { section.attachments.neutral {
background: #E7F2FA; border-color: transparent;
background-color: transparent;
} }
section.attachments.neutral > div.label {
section.attachments.grey label { color: #505050;
color: #fff;
background: #505d65;
} }
section.attachments.grey .attachments-files {
background: #f4f4f4;
}
/* Children shortcode */
/* Children shortcode */ /* Children shortcode */
.children p { .children p {
font-size: small; font-size: small;