Ghost/ghost/minifier/test/fixtures/basic-cards/js/gallery.js
Hannah Wolfe 03b1e9c3bd Minifier initial version
- wired up a basic minification package
- accepts config for css or js files and can concat and minify them into a single file for each type
- this will be used for generating merged css and js files for various cards, controlled by theme config
2021-11-03 14:16:49 +00:00

9 lines
328 B
JavaScript

var images = document.querySelectorAll('.kg-gallery-image img');
images.forEach(function (image) {
var container = image.closest('.kg-gallery-image');
var width = image.attributes.width.value;
var height = image.attributes.height.value;
var ratio = width / height;
container.style.flex = ratio + ' 1 0%';
})