Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.
/ boobreaks Public archive

Use Bootstraps breakpoints inside your JavaScript!

License

Notifications You must be signed in to change notification settings

muuvmuuv/boobreaks

Repository files navigation

Boobreaks 📏

Demo

A simple and small (881 bytes) utility to make Bootstraps breakpoints available in your JavaScript files.

Tested with Bootstrap version: 4.3.1

Installation

npm install boobreaks

How to use

UMD

Load the library:

<!-- <head> -->
<link rel="stylesheet" href="./path/to/boobreaks.umd.css" />
<script defer src="./path/to/boobreaks.umd.js"></script>
<!-- </head> -->

Use it:

console.log(`Breakpoint is at`, Boobreaks.current(), Boobreaks.width())

CommonJS

import 'boobreaks/dist/boobreaks.css'
import { current, width } from 'boobreaks'

console.log(`Breakpoint is at`, current(), width())

Available functions

Function Params Return Description
current() none string Current breakpoint alias.
width() none number Current screen width by alias.
is() expression string If the current screen matches the expression, e.g.: >=sm