@superherocheesecake/adaptive

1.2.2 • Public • Published

Adaptive

Read the document and provide JS with the same breakpoints that where defined in CSS

NPM installation

npm i --save @superherocheesecake/adaptive

Require the module

import { adaptive } from '@superherocheesecake/adaptive');

Events

isMediaQueryActive(name)

adaptive.addEventListerner("change:mediaquery", [handler]);

Methods

isMediaQueryActive(name)

adaptive.isMediaQueryActive("regular");

CSS setup

Adaptive will look for a string reference in the html before pseudo element. That string needs to start with 'adaptive:'.

@media (max-width: 1024px) {
  html:before {
    position: absolute;
    display: none;
    content: "adaptive:regular";
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @superherocheesecake/adaptive

Weekly Downloads

0

Version

1.2.2

License

none

Unpacked Size

11.2 kB

Total Files

12

Last publish

Collaborators

  • n0cha
  • edwardmediamonks
  • wesleysmulders
  • ksawery.mediamonks
  • vandenhork25
  • johanholwerda
  • renedrie
  • kristemmerman123
  • odin.schwartz
  • bolex222
  • coco_g
  • frontend_shcc
  • alfred_shcc
  • carinashcc
  • lukasfeitsma
  • jameswhite
  • raul.roman
  • jaak.kivinukk