mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
shortcodes: avoid superflous margin at start and end of content #558
This commit is contained in:
parent
30b23b9213
commit
5ca1c4c5f0
4 changed files with 9 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
{{ $title | .RenderString }}
|
{{ $title | .RenderString }}
|
||||||
</label>
|
</label>
|
||||||
<div id="expandcontent-{{ $id }}" class="expand-content">
|
<div id="expandcontent-{{ $id }}" class="expand-content">
|
||||||
|
{{ if ne "<" (substr (strings.TrimLeft " " $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
|
||||||
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -19,6 +19,7 @@
|
||||||
<div class="box notices cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
<div class="box notices cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
|
{{ if ne "<" (substr (strings.TrimLeft " " $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
|
||||||
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -19,6 +19,7 @@
|
||||||
data-tab-item="{{ .name | $context.RenderString | plainify }}"
|
data-tab-item="{{ .name | $context.RenderString | plainify }}"
|
||||||
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
|
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
|
||||||
>
|
>
|
||||||
|
{{ if ne "<" (substr (strings.TrimLeft " " .content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
|
||||||
{{ .content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
{{ .content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -444,7 +444,9 @@ div.box > .box-content {
|
||||||
#body table td > :first-child,
|
#body table td > :first-child,
|
||||||
#body table td > :first-child :first-child,
|
#body table td > :first-child :first-child,
|
||||||
#body div.box > .box-content > :first-child,
|
#body div.box > .box-content > :first-child,
|
||||||
#body div.box > .box-content > :first-child :first-child {
|
#body div.box > .box-content > :first-child :first-child,
|
||||||
|
#body div.tab-content > .tab-content-text > :first-child,
|
||||||
|
#body div.tab-content > .tab-content-text > :first-child :first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +455,9 @@ div.box > .box-content {
|
||||||
#body table td > :last-child,
|
#body table td > :last-child,
|
||||||
#body table td > :last-child :last-child,
|
#body table td > :last-child :last-child,
|
||||||
#body div.box > .box-content > :last-child,
|
#body div.box > .box-content > :last-child,
|
||||||
#body div.box > .box-content > :last-child :last-child {
|
#body div.box > .box-content > :last-child :last-child,
|
||||||
|
#body div.tab-content > .tab-content-text > :last-child,
|
||||||
|
#body div.tab-content > .tab-content-text > :last-child :last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue