{"id":16458335,"url":"https://github.com/flexbox/pokemon-breakpoint","last_synced_at":"2025-04-04T17:13:34.249Z","repository":{"id":9650227,"uuid":"11586030","full_name":"flexbox/pokemon-breakpoint","owner":"flexbox","description":"A fun way to make the connection between breaking points in CSS media queries and Javascript files","archived":false,"fork":false,"pushed_at":"2018-05-10T16:55:21.000Z","size":2342,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T02:27:08.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://flexbox.github.io/pokemon-breakpoint/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexbox.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":"2013-07-22T16:15:51.000Z","updated_at":"2020-02-08T22:28:47.000Z","dependencies_parsed_at":"2022-09-04T23:14:30.276Z","dependency_job_id":null,"html_url":"https://github.com/flexbox/pokemon-breakpoint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexbox%2Fpokemon-breakpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexbox%2Fpokemon-breakpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexbox%2Fpokemon-breakpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexbox%2Fpokemon-breakpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexbox","download_url":"https://codeload.github.com/flexbox/pokemon-breakpoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"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":[],"created_at":"2024-10-11T10:44:58.299Z","updated_at":"2025-04-04T17:13:34.214Z","avatar_url":"https://github.com/flexbox.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Pokemon breakpoint](http://pokemonbreakpoint.fr)\n\n### Make a connection between your CSS and your Javascript\n\nWe have a problem in responsive design : We define breakpoints in CSS and maybe you have to use it in your Javascript.\nPokemon breakpoint is a fun way to make the connection between the 2 worlds.\n\n## One rule to catch them all\nYour naming is a crutial for your application.\nIn this exemple we are going to associate media queries defined in `stylesheets/foundation/_settings.scss` with your javascript files.\n\n    $small-screen: 641px !default;\n    $medium-screen: 1280px !default;\n    $large-screen: 1440px !default;\n\nNow we must find a good naming for the id `#media-query--name`.\nFor exemple you can take the 3 states of a random pokemon.\nIn `stylesheets/_breakpoint.scss` remplace `#media-query--name:after` by your new explicit naming\n\n    @media #{$small} {\n      #media-query--name:after{\n        content: \"reptincel\";\n      }\n    }\n\n## How it works ?\n```js\n// You create a new PokeBreak instance and pass the element id to the constructor\n//  (`#media-query--name` here).\nvar pkBrk = new PokeBreak('media-query--name');\n// Than, you can read the current state\nconsole.log('Current state is '+pkBrk.pokeball()+'.');\n// Or you can listen to state changes\npkBrk.listen(function(oldPokemon, newPokemon) {\n\tconsole.log('Just switched from '+oldPokemon+' to '+newPokemon+'.');\n});\n\nYou can listen to different break point groups by creating many PokeBreak instances.\n```\n\n## Tutorial\n\n- Read the [associated blog post](http://blog.davidleuliette.com)\n- Ding into code and read `stylesheets/pokemon.scss`\n\n## Contribute\n\nThis is Github folks!\n\nIf you find a *bug*, open an [Issue](https://github.com/flexbox/pokemon-breakpoint/issues).\n\nYou can also make a Pull Request, I *always* respond, and try to do it fast.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexbox%2Fpokemon-breakpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexbox%2Fpokemon-breakpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexbox%2Fpokemon-breakpoint/lists"}