{"id":21006149,"url":"https://github.com/vxsx/bootstrap-breakpoints","last_synced_at":"2025-07-10T10:36:29.524Z","repository":{"id":25110250,"uuid":"28531626","full_name":"vxsx/bootstrap-breakpoints","owner":"vxsx","description":"Tiny script to easily check what the current bootstrap breakpoint is","archived":false,"fork":false,"pushed_at":"2016-12-15T16:53:51.000Z","size":281,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T20:18:20.171Z","etag":null,"topics":["bootstrap","breakpoint","breakpoints","javascript"],"latest_commit_sha":null,"homepage":"http://vxsx.github.io/bootstrap-breakpoints/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vxsx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-27T07:48:14.000Z","updated_at":"2023-06-06T23:10:05.000Z","dependencies_parsed_at":"2022-08-23T19:40:45.371Z","dependency_job_id":null,"html_url":"https://github.com/vxsx/bootstrap-breakpoints","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxsx%2Fbootstrap-breakpoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxsx%2Fbootstrap-breakpoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxsx%2Fbootstrap-breakpoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxsx%2Fbootstrap-breakpoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vxsx","download_url":"https://codeload.github.com/vxsx/bootstrap-breakpoints/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254256747,"owners_count":22040351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","breakpoint","breakpoints","javascript"],"created_at":"2024-11-19T08:49:39.608Z","updated_at":"2025-05-15T01:33:45.620Z","avatar_url":"https://github.com/vxsx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Boostrap Breakpoints\n====================\n\n[![Build Status](https://travis-ci.org/vxsx/bootstrap-breakpoints.svg?branch=master)](https://travis-ci.org/vxsx/bootstrap-breakpoints)\n[![Code Climate](https://codeclimate.com/github/vxsx/bootstrap-breakpoints/badges/gpa.svg)](https://codeclimate.com/github/vxsx/bootstrap-breakpoints)\n[![Test Coverage](https://codeclimate.com/github/vxsx/bootstrap-breakpoints/badges/coverage.svg)](https://codeclimate.com/github/vxsx/bootstrap-breakpoints)\n\nTiny script to enable easier checks for current responsive breakpoint. Assumes you are using bootstrap, but can potentially work with other custom breakpoints.\n\n## Usage\n\nPut the script somewhere in the html as you usually do.\nFor now the script depends on jQuery and works in IE9+.\n\n```js\nBreakpoint.init();\n\nif (Breakpoint.is('xs')) {\n    //do mobile stuff\n}\n\nif (Breakpoint.is('sm')) {\n    //do tablet stuff\n}\n\n$(window).on('change:breakpoint', function (e, current, previous) {\n    console.log('previous breakpoint was', previous);\n    console.log('current breakpoint is', current);\n});\n\n//etc\n```\n\nIf you need to customize breakpoint values, you do\n\n```\nBreakpoint.init({\n    xs: {\n        min: 0,\n        max: 499\n    },\n    sm: {\n        min: 500,\n        max: 1000\n    }\n    //etc\n});\n```\n\n## How it works\n\nOn init script registers an event handler on window resize where it just checks window.width \nand if correct breakpoint is found it sets the value internally as well as triggering 'change:breakpoint' event\non window.  You may want to throttle the event handler, but it's not yet possible without modifying source code. Also, keep in mind that it is assumed that breakpoints you provide are mutually exclusive, otherwise detected current breakpoint may be not the one you expect.\n\n## API\n\n### `.is(breakpoint)`\n\nReturns true if passed value is a correct breakpoint.\n\n### `.current()`\n\nReturns string representing current breakpoint (xs, sm, etc).\n\n### `.getBreakpoints()`\n\nGet all the breakpoints values.\n\n### `.init(breakpoints)`\n\nInitializes the script. Without calling this first - won't work.\n\n### `.destroy()`\n\nRemoves resize watcher.\n\n## Demo\n\n[http://vxsx.github.io/bootstrap-breakpoints/](http://vxsx.github.io/bootstrap-breakpoints/)\n\n\n## Contributing\n\nMake PR, write your stuff, don't forget tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvxsx%2Fbootstrap-breakpoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvxsx%2Fbootstrap-breakpoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvxsx%2Fbootstrap-breakpoints/lists"}