Socket
Socket
Sign inDemoInstall

actual

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    actual

Determine actual @media breakpoints


Version published
Weekly downloads
1.1K
decreased by-3.66%
Maintainers
1
Install size
8.18 kB
Created
Weekly downloads
 

Readme

Source

actual

Determine actual @media breakpoints for CSS range features
  • actual calculates responsive breakpoints that accurately match CSS media queries
  • actual is based on this gist

API

actual(feature, unit?, init?, step?)

  • feature: CSS range feature name
  • unit: applicable CSS unit (default: unitless)
  • init: initial guess (default: 1)
  • step: step size (default: varies by unit)
  • @return number (breakpoint)
  • Alias: actual.actual
actual('width', 'em') // => 87.40625
actual('device-width', 'px') // => 1440
actual('resolution', 'dpi') // => 96
actual('color') // => 10

actual.is(query)

  • Test if a media query is active
  • @return boolean
  • Alias: actual.mq
actual.is('tv')
actual.is('(width:30em)')

actual.as(unit)

  • Create a partial function that gets a given feature in unit
  • @return function
['width', 'height', 'device-width', 'device-height'].map(actual.as('px'))

Compatibility

  • Chrome 9+, FF6+, IE9+, Opera 12.1, Safari 5.1 or elsewhere via matchMedia or msMatchMedia
  • Results depend on browser @media support for the feature in question

npm

npm install actual --save

Contribute

npm install
npm test

Fund

Tip the developer =)

Keywords

FAQs

Last updated on 09 Jan 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc