3 Commits

Author SHA1 Message Date
Mohamed Shaaban
33a38ef619 viewport-addon: configure => configureViewport 2018-04-14 18:33:48 +02:00
Mohamed Shaaban
d3046596ba Allow setting custom default viewport per story
Fix linting issues
2018-03-20 00:51:41 +01:00
Mohamed Shaaban
9b1370f3d6 Add support to configure viewport addon
- By default, viewport addon is reading both initial viewports' set and default viewport from
`INITIAL_VIEWPORTS` and `DEFAULT_VIEWPORT` respectively which are exported by the addon
 - `configure` function is exported which accepts an object with `defaultViewport` and `viewports`
 - Change the default viewport by setting `defaultViewport` property to the key of the viewport (e.g. `configure({ defaultViewport: 'iphone5' })`)
 - Replace the entire viewports by setting brand new viewports to `viewports` property (e.g. `configure({ viewports: { brandNewDevice: { ... } } })`)
 - Add custom viewports by first merging both the `INITIAL_VIEWPORTS` and your custom viewports, and then pass the result as `viewports` to configure function
2018-03-20 00:50:22 +01:00