├── package.json ├── README.md ├── index.js └── src.js /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tailwind-breakpoint-tool", 3 | "version": "1.0.0", 4 | "description": "A simple breakpoint tool for development of your Tailwind sites.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/thedevdojo/tailwind-breakpoint-tool.git" 12 | }, 13 | "keywords": [ 14 | "tailwindcss", 15 | "tailwind", 16 | "tailwind", 17 | "tools", 18 | "breakpoint", 19 | "responsive" 20 | ], 21 | "author": "Tony Lea", 22 | "license": "ISC", 23 | "bugs": { 24 | "url": "https://github.com/thedevdojo/tailwind-breakpoint-tool/issues" 25 | }, 26 | "homepage": "https://github.com/thedevdojo/tailwind-breakpoint-tool#readme" 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🛠️ TailwindCSS Breakpoint Tool 2 | 3 | A simple breakpoint notification that shows up at the top of the screen when you resize your window and hides after you stop resizing. 4 | 5 | ```html 6 | 7 | ``` 8 | 9 | https://github.com/thedevdojo/tailwind-breakpoint-tool/assets/601261/5e7af794-1ccd-4f33-9e76-28e26f0a0662 10 | 11 | ## How to use 12 | 13 | This tool is only meant to be used during development and it works pairs perfectly with the Tailwind Play CDN. You can include this tool right alongside it: 14 | 15 | ```html 16 | 17 | 18 | 19 | ``` 20 | Resize your window and see the little breakpoint tool pop down from the top of the screen 🔮 21 | 22 | --- 23 | 24 | This tool utilizes some Tailwind classes itself, so if you are not utilizing the TailwindCDN there may be some classes that do not display correctly. In this case you may just want to copy and paste the javascript from the `index.js` anywhere on your page. 25 | 26 | ```html 27 | 30 | ``` 31 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded",function(){let e=null,n="breakPoints",t=function(){document.getElementById(n)&&(document.getElementById(n).classList.add("-translate-y-full"),document.getElementById(n).classList.remove("mt-3"),setTimeout(function(){document.getElementById(n).remove()},500))};window.addEventListener("resize",function(l){let s=window.innerWidth,d=document.createElement("div");if(d.id=n,d.className="fixed top-0 ease-out duration-300 flex -translate-y-full items-center w-auto px-2 py-1 text-xs text-gray-200 -translate-x-1/2 border rounded-full border-neutral-200/50 dark:border-neutral-700/70 shadow-3xl backdrop-blur-lg bg-white/80 dark:bg-neutral-900 left-1/2",d.style.zIndex=9999,!document.getElementById(n)){let a=` 2 |