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

bootstrap-detect-breakpoint

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap-detect-breakpoint - npm Package Compare versions

Comparing version 1.0.6 to 1.0.8

9

package.json
{
"name": "bootstrap-detect-breakpoint",
"version": "1.0.6",
"version": "1.0.8",
"description": "Detect the current Bootstrap 4 breakpoint in JavaScript",

@@ -24,8 +24,3 @@ "main": "index.js",

},
"homepage": "https://github.com/shaack/bootstrap-detect-breakpoint#readme",
"devDependencies": {
"bootstrap": "^4.4.1",
"jquery": "^3.5.1",
"popper.js": "^1.16.1"
}
"homepage": "https://github.com/shaack/bootstrap-detect-breakpoint#readme"
}

@@ -5,2 +5,5 @@ # bootstrap-detect-breakpoint

- [Demo Page](https://shaack.com/projekte/bootstrap-detect-breakpoint/)
- [npm Package](https://www.npmjs.com/package/bootstrap-detect-breakpoint)
## Usage

@@ -7,0 +10,0 @@

const bootstrapDetectBreakpoint = function () {
const breakpointNames = ["xl", "lg", "md", "sm", "xs"]
let breakpointValues = []
for (const breakpointName of breakpointNames) {
breakpointValues[breakpointName] = window.getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-' + breakpointName)
// cache some values on first call
if (!this.breakpointValues) {
this.breakpointNames = ["xl", "lg", "md", "sm", "xs"]
this.breakpointValues = []
for (const breakpointName of this.breakpointNames) {
this.breakpointValues[breakpointName] = window.getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-' + breakpointName)
}
}
let i = breakpointNames.length
for (const breakpointName of breakpointNames) {
let i = this.breakpointNames.length
for (const breakpointName of this.breakpointNames) {
i--
if (window.matchMedia("(min-width: " + breakpointValues[breakpointName] + ")").matches) {
if (window.matchMedia("(min-width: " + this.breakpointValues[breakpointName] + ")").matches) {
return {name: breakpointName, index: i}

@@ -12,0 +15,0 @@ }

Sorry, the diff of this file is not supported yet

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