Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

webfactory/breakpoints-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

A JS/SCSS utility that syncs (S)CSS breakpoints with runtime JavaScript by exporting breakpoint maps as CSS custom properties and providing a tiny JS helper to read and compare them against the current viewport (e.g. bp.lessThan, bp.greaterThan).

Installation

npm install @webfactoryde/breakpoints-export

Usage

Define your breakpoints as a Sass map and import the SCSS mixin in your module(s) and use it to generate the necessary Custom Properties:

@use'@webfactoryde/breakpoints-export'as*;$breakpoints: (screen-m:768px,screen-l:1200px,navigation-breakpoint:875px,);@includebreakpoints-export($breakpoints);

Import thebreakpoints-export function in your module(s) and use the comparison you need:

// your moduleimportbpfrom'@webfactoryde/breakpoints-export';if(bp.greaterThan('navigation-breakpoint')){// do cool stuff}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp