Update figure shortcode to properly float left and right
This commit is contained in:
@@ -92,17 +92,26 @@ figure {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: 25px 0;
|
margin: 25px 0;
|
||||||
|
|
||||||
&.left {
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.center {
|
&.center {
|
||||||
margin-left: auto;
|
width: 100%;
|
||||||
margin-right: auto;
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
width: 50%;
|
||||||
|
float: left;
|
||||||
|
padding-right: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.right {
|
&.right {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
padding-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
figcaption {
|
figcaption {
|
||||||
@@ -122,7 +131,7 @@ figure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.right {
|
&.right {
|
||||||
text-align: right;
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{ if .Get "src" }}
|
{{ if .Get "src" }}
|
||||||
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
|
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "containerStyle" }} style="{{ . | safeCSS }}" {{ end }} >
|
||||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
||||||
{{ if .Get "caption" }}
|
{{ if .Get "caption" }}
|
||||||
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | safeHTML }}</figcaption>
|
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | safeHTML }}</figcaption>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user