Closed monish001 closed 7 years ago
There isn't currently an option that can do this. But you could configure this by setting a maxWidth variable in your Gruntfile and then doing a calculation on this within GRI (Grunt Responsive Images).
For example:
At top of Gruntfile.js
var maxWidth = 1000;
In configuration of GRI for 50% of the width:
sizes: [{
name: 'resized',
width: maxWidth/100 * 50 + 'px'
}]
Hope that helps?
Context/Scenario
I have 2 images on a webpage - logo.png that is given 10% width and hero-image.png that is given 100%. Also, the max-width for the webpage is set to 1000px.
Can I generate following images:
In other words, how about giving an option where we specify width in pc taken by each image on a webpage?