1.0.14-beta.0 • Published 8 months ago

rollup-plugin-responsive-app v1.0.14-beta.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

rollup-plugin-responsive-app beta

A Rollup plugin to automatically handle your app responsiveness:

  • Set up and ready
  • Major frontend frameworks compatible
  • Web accessible compliant
  • Mobile screen auto-adaptation experimental

Demo

The plugin will make sure the app proportions are the same across all screen resolutions:

Responsive app demo

Install

npm i -D rollup-plugin-responsive-app

Usage

In your rollup.config.js or vite.config.js file:

import responsive from 'rollup-plugin-responsive-app'

export default {
  ...
  plugins: [
    ...,
    // Last plugin on the list
    responsive()
  ],
};

Options

You can pass an object with options to responsive({...}):

NameTypeDescriptionDefault
appEntryundefined | stringYour application entry pointWill try to resolve as index.html, app.js, main.js or src/index.js
transformPixelsboolean | TransformPixelsOptionsConvert pixel definitions to remtrue
handleMobileboolean | HandleMobileOptionsAuto-adapt the interface for mobile screens experimentaltrue

TransformPixelsOptions

NameTypeDescriptionDefault
ignoreAttributesstring[]List of CSS attributes to be bypassed. You can set as ['box-shadow', 'border-radius'] for example[]
ignoreSelectorsstring[]List of CSS selectors to be bypassed[]

HandleMobileOptions

NameTypeDescriptionDefault
ignoreSelectorsstring[]List of CSS selectors to be bypassed[]
centralizeTextstring[]List of elements to be centralized'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'
breakpointstringMax screen width (when to consider as "mobile")480px

Bypassing transformations

You can also add the ignore-responsive-app class to any HTML element so the above transformations do not have effect. Example:

<div class="width-300px ignore-responsive-app">
  My width will remain in pixels!
</div>

Beta phase

The plugin currently sits on the beta version. Test it on your fresh app and open a Github issue if it is not working on your context.

1.0.14-beta.0

8 months ago

1.0.13-beta.0

8 months ago

1.0.12-beta.0

8 months ago

1.0.11-beta.0

9 months ago

1.0.5-beta.10

9 months ago

1.0.4-beta.10

9 months ago

1.0.3-beta.10

9 months ago

1.0.2-beta.10

9 months ago

1.0.1-beta.10

9 months ago

1.0.0-beta.9

9 months ago

1.0.0-beta.8

9 months ago

1.0.0-beta.7

9 months ago

1.0.0-beta.6

9 months ago

1.0.0-beta.4

9 months ago

1.0.0-beta.2

9 months ago

1.0.0-beta.1

9 months ago

1.0.0-beta.0

9 months ago