Commit 981c71db authored by gijs's avatar gijs
Browse files

Styles for figures

parent cec78660
...@@ -47,7 +47,11 @@ ...@@ -47,7 +47,11 @@
for (var i=0; i < images.length; i++) { for (var i=0; i < images.length; i++) {
images[i].addEventListener('click', function () { images[i].addEventListener('click', function () {
this.classList.toggle('full'); if (this.parentElement && this.parentElement.tagName.lower() == 'figure') {
this.parentElement.classList.toggle('full');
} else {
this.classList.toggle('full');
}
}) })
} }
})(); })();
......
<figure class="image"> <figure class="image">
{% if image.title %} {% if image.title.value %}
<h3>{{ image.title }}</h3> <h4>{{ image.title }}</h4>
{% endif %} {% endif %}
<img src="{{ image.image }}" /> <img src="{{ image.image }}" />
{% if image.caption %} {% if image.caption.value %}
<figcaption> <figcaption>
{{ image.caption }} {{ image.caption }}
</figcaption> </figcaption>
......
...@@ -466,7 +466,7 @@ ul.simplelist > li:before { ...@@ -466,7 +466,7 @@ ul.simplelist > li:before {
margin: 0; margin: 0;
} }
main img { main img, main figure {
width: 33%; width: 33%;
float: left; float: left;
margin-right: .5em; margin-right: .5em;
...@@ -476,18 +476,29 @@ main img { ...@@ -476,18 +476,29 @@ main img {
clear: left; clear: left;
} }
main img.full { main img.full, main figure.full img {
cursor: zoom-out; cursor: zoom-out;
} }
main img.full, main img.full,
main audio, main audio,
main video { main video,
main figure.full figcaption {
max-width: 47.5em; max-width: 47.5em;
width: 100%; width: 100%;
margin-top: .5em;
margin-bottom: .5em;
} }
main figure img {
width: 100%;
float: none;
margin-top: 0;
margin-bottom: 0;
}
figcaption {
font-size: 80%;
}
/* /*
a.tag { a.tag {
font-size: 85%; font-size: 85%;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment