ManifoldScholar / manifold

Transforming scholarly publications into living digital works.
http://manifoldapp.org
GNU General Public License v3.0
235 stars 30 forks source link

Feature request: allow units in resource sizes #3590

Closed benmiller314 closed 11 months ago

benmiller314 commented 1 year ago

In the settings for interactive resources, there are fields to support an optional minimum height and minimum width. These fields, however, seem to only accept numbers, which are then converted to a fixed number of pixels. I discovered this when trying to use a viewport unit, because declaring an absolute minimum number of pixels is a recipe for awkward overflow on screen sizes smaller than the one on which we're preparing the document. (Indeed, setting a minimum rather than a maximum width also runs the risk of the resource overflowing the available space, preventing the iframe from responsively scaling for mobile devices or side-by-side browser windows.)

I've confirmed that iframes can take viewport units for their own widths and heights, though in that case width and height have to be set in the CSS rather than in the HTML itself. I hope this isn't too big of a barrier.

If the issue is instead more about the challenges of parsing input from the webform, would it be possible instead to add a pulldown menu on the form that allows us to specify units? This would also clarify to users that px is the default, if that's what you prefer.

Grateful for your consideration of this enhancement!

1aurend commented 11 months ago

Resolved in #3636