Mango/slideout

Non fixed pixel widths for slide out padding

arpowers opened this issue · 1 comments

Looks like the current options only allow for a 'px' based width on the menu?

A superior way to handle this would be to allow for other units like 'vw' so we could do something like:
padding: 80vw

As of now we're stuck with the same menu with on all devices.

It's not the prettiest solution, but you could use something like

var slideout = new Slideout({
    'panel': document.getElementById('panel'),
    'menu': document.getElementById('menu'),
    'padding': Math.floor(window.innerWidth * 0.8), // key change
    'tolerance': 70
});