newsdev / ai2html

A script for Adobe Illustrator that converts your Illustrator artwork into an html page.
http://ai2html.org
Other
897 stars 145 forks source link

Override responsiveness setting per artboard #116

Closed kevinschaul closed 5 years ago

kevinschaul commented 5 years ago

Hi all,

We've found it useful to be able to override the responsiveness setting for specific artboards. Often we want out smaller widths to flow responsively but not necessarily worry about the responsiveness of gaps between our larger artboards.

This PR allows overriding the responsiveness value of an artboard via the artboard name: Artboard names that begin with f- will be rendered in "fixed" mode, and names that begin with d- will be rendered in "dynamic" mode. (I wasn't sure if there was another way to specify data on artboards. If you have other ideas I'd love to hear them.)

Thanks as always for open sourcing such a useful tool.

mbloch commented 5 years ago

Kevin, this is a useful addition. Before merging, I'd like to change the form of these override settings. There is already another way to stash data in an artboard name (layer names too). Instead of prefixes like f- and d-, you can append settings, like this: artboard_name:responsive and artboard_name:dynamic. There is a function for converting this kind of annotation to a JS object, getArtboardSettings(artboard).

Before merging, I also need to look into interactions between this feature and some NYT-specific code relating to responsiveness and breakpoints.

Thanks for this contribution :)

mbloch commented 5 years ago

I merged your PR after switching from f- and d- prefixes to :dynamic and :fixed suffixes. Thanks :)

kevinschaul commented 5 years ago

Awesome thank you @mbloch !