New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

breakpoint-checker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

breakpoint-checker

Query window viewport or element widths with specific breakpoints

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Breakpoint Checker

Query window viewport or element widths with specific breakpoints

Installation

NPM

npm i breakpoint-checker

Yarn

yarn add breakpoint-checker

Bower

bower install breakpoint-checker --save

Usage

If the window viewport is equal or lower than the given breakpoint return true

if (breakpoint(breaks.medium)) {
  ...
}

If the windw viewport is equal or lower than the given breakpoint name return true

if (breakpoint('medium')) {
  ...
}

Rather than calling an if statment, you can check the width of a given element against a given breakpoint and call an anonymous function if the element width is equal or less than the given breakpoint

$('body').breakpoint(breaks.medium, function() {
  ...
});

Simple check. Checks if the current window is less than or equal to the given breakpoint

breakpoint('medium');

Calls function if given breakpoint if euqal or less than the window viewport

breakpoint('medium', function() {
  ...
});

You can add breakpoints manually too. So you don't have to rely on custom-props and customPropsExention for this plugin If the name is the same as a previously defined breakpoint. It will be overwritten

addBreakpoint('small', 111);
addBreakpoint({'special': 222, 'small' : 333});

FAQs

Package last updated on 21 May 2017

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