Skip to content

Decad/MediaFaker

Repository files navigation

Media Faker

Treat an element as if its the viewport for css. Making media queries work without an iframe.

Usage

var mf = new mediafaker({
  // The target element as a selector or dom referrence
  element: '.stage',
});

Note

Currently Media Faker removes all media queries in any active stylesheet, soon this will be configurable.

Use Cases

This is a pretty obscure library so Why use this? MediaFaker was created for use in documentation for a component library. Allowing users to see how the component works at different viewport sizes without having to resize their browser.

Examples

See the examples folder for examples

Bootstrap

Running bootstrap media queries inside a resizable div without using an Iframe

example

License

MIT

About

Run mediaqueries inside an element

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published