postcss-overflow-overlay

1.0.0 • Public • Published

PostCSS Overflow Overlay

npm npm

PostCSS plugin for adding 'overflow: overlay' style for elements with 'overflow: auto' style.

/* Input example */
.foo {
  overflow: auto;
}

/* Output example */
.foo {
  overflow: auto;
  overflow: overlay;
}

🍳 Usage

Step 1: Install plugin:

npm install --save-dev postcss postcss-overflow-overlay

Step 2: Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

Step 3: Add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-overflow-overlay'),
    require('autoprefixer')
  ]
}

📝 More Example

/* Input */
.foo {
  overflow-x: auto;
}

/* Output */
.foo {
  overflow-x: auto;
  overflow-x: overlay;
}
/* Input */
.foo {
  overflow: hidden auto;
}

/* Output */
.foo {
  overflow: hidden auto;
  overflow: hidden overlay;
}
/* Input */
.foo {
  overflow: auto !important;
}

/* Output */
.foo {
  overflow: auto !important;
  overflow: overlay !important;
}
/* Input */
.foo {
  overflow: auto;
  overflow: scroll;
}

/* Output */
.foo {
  overflow: auto;
  overflow: overlay;
  overflow: scroll;
}
/* Input */
.foo {
  overflow: auto;
  overflow: auto;
}

/* Output */
.foo {
  overflow: auto;
  overflow: overlay;
  overflow: auto;
}
/* Input */
.foo {
  /** overflow-overlay: off */
  overflow: auto;
}

/* Output */
.foo {
  overflow: auto;
}

/postcss-overflow-overlay/

    Package Sidebar

    Install

    npm i postcss-overflow-overlay

    Weekly Downloads

    5

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.28 kB

    Total Files

    6

    Last publish

    Collaborators

    • hcl2020