Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parallaxagency/conditioner

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parallaxagency/conditioner

### `@idle`

  • 0.0.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Monitors

@idle

This monitor will match when requestIdleCallback fires. Once matching it will never unmatch so typically you would use this with the was modifier:

<div data-module="carousel" data-context="was @idle"></div>

This monitor uses the requestIdleCallback and cancelIdleCallback polyfills from GoogleChromeLabs/idlize

@visible

This monitor uses IntersectionObserver to match when the element is visible in the viewport:

<div data-module="carousel" data-context="@visible {threshold}"></div>

In this example the carousel module will mount when the element enters the viewport, and unmount when it leaves. You can use the was modifier to avoid the module being unmounted.

Note: this monitor does not include an IntersectionObserver polyfill

Options

threshold – how much of the element should be visible in order for the monitor to match (between 0 and 1) – default is 0

@connection

Uses the Network Information API to match against the user’s "effective connection type":

<div data-module="carousel" data-context="initial @connection {type}"></div>
Options

type – the connection type: slow-2g, 2g, 3g, or 4g.

@saveData

Matches when the user has Save-Data enabled. Consider using the initial modifier with this monitor to only check this once on load.

<div data-module="carousel" data-context="@saveData"></div>

@screen

This monitor can be used to match against Tailwind CSS screen sizes:

<div data-module="carousel" data-context="@screen {name}"></div>

To use this monitor you will need to provide your Tailwind screens config:

import conditioner, { screen } from '@parallaxagency/conditioner'
import tailwindScreens from './screens.js'

conditioner.addPlugin(screen(tailwindScreens))

Tip: use the not modifier to match the inverse of the media query

Options

name – the Tailwind screen name. e.g. sm

Components

Scroll

FAQs

Package last updated on 22 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc