{"id":18600812,"url":"https://github.com/octet-stream/tailwindcss-device","last_synced_at":"2026-02-06T09:04:41.401Z","repository":{"id":149890195,"uuid":"621036246","full_name":"octet-stream/tailwindcss-device","owner":"octet-stream","description":"TailwindCSS plugin to add variants for input device detection using `@media` queries","archived":false,"fork":false,"pushed_at":"2025-08-12T01:49:21.000Z","size":586,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T12:12:54.954Z","etag":null,"topics":["media-queries","postcss","tailwindcss","tailwindcss-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/tailwindcss-device","language":"TypeScript","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/octet-stream.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-29T21:37:01.000Z","updated_at":"2025-01-29T20:15:28.000Z","dependencies_parsed_at":"2025-01-23T19:29:25.651Z","dependency_job_id":"efe8795f-ba50-429d-8e8b-9af39e1dbc8d","html_url":"https://github.com/octet-stream/tailwindcss-device","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/octet-stream/tailwindcss-device","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Ftailwindcss-device","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Ftailwindcss-device/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Ftailwindcss-device/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Ftailwindcss-device/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octet-stream","download_url":"https://codeload.github.com/octet-stream/tailwindcss-device/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Ftailwindcss-device/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29156402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["media-queries","postcss","tailwindcss","tailwindcss-plugin"],"created_at":"2024-11-07T02:05:43.621Z","updated_at":"2026-02-06T09:04:41.382Z","avatar_url":"https://github.com/octet-stream.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tailwindcss-device\n\nTailwindCSS plugin to add variants for input device detection using [`@media` queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries)\n\n## Installation\n\npnpm\n\n```sh\npnpm add -D tailwindcss-device\n```\n\nnpm\n\n```\nnpm i -D tailwindcss-device\n```\n\nyarn\n\n```\nyarn add -D tailwindcss-device\n```\n\n### Usage\n\nThe plugin comes in two versions: One is CSS and meant for tailwind\n\n#### With v4\n\nThere're two options for v4:\n\n1. Add plugin to your `tailwind.css` file using the `@import` directive, like this:\n\n```css\n@import \"tailwindcss\";\n\n@import \"tailwindcss-device\"; /* \u003c- This will import CSS version of the plugin */\n```\n\n2. Or use its JavaScript version via `@plugin` directive:\n\n```css\n@import \"tailwindcss\";\n\n@plugin \"tailwindcss-device\"; /* \u003c- This will use legacy JavaScript version */\n```\n\n#### With v3\n\n1. Add plugin to your `tailwind.config.js` plugins section:\n\n```ts\nimport device from \"tailwindcss-device\"\n\nexport default {\n  plugins: [\n    device,\n    // ...\n\n    // or with custom prefix:\n    deivce({prefix: \"device\"})\n  ]\n}\n```\n\n2. And then prefix utilities using available variants:\n\n```html\n\u003cdiv class=\"border border-black rounded-md device-touch:rounded-lg\"\u003e\n  \u003cdiv class=\"hidden device-touch:block\"\u003e\n    Hello, I'm visible on smartphones and tables!\n  \u003c/div\u003e\n  \u003cdiv class=\"hidden device-desktop:block\"\u003e\n    Hello, I'm visible on computer with mouse!\n  \u003c/div\u003e\n\u003cdiv\u003e\n```\n\n3. The result will look like this:\n\n```css\n.hidden {\n  display: none;\n}\n\n@media (pointer: coarse) {\n  .device-touch\\:block {\n    display: block;\n  }\n}\n\n@media (pointer: fine) or (pointer: none) {\n  .device-desktop\\:block {\n    display: block;\n  }\n}\n```\n\n## Available variants\n\n| Name          | Target                                                                         |\n|---------------|--------------------------------------------------------------------------------|\n| touch         | Devices with touchscreen as primary input method (e.g smartphones and tablets) |\n| desktop       | Computers with a mouse                                                         |\n| desktop-touch | Computers with touch input device                                              |\n| desktop-any   | Computers with or without touch input device                                   |\n\n## Useful links\n\n* [Media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries) reference documentation on MDN\n* [Using media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) documentation on MDN\n* [`any-pointer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/any-pointer) media feature documentation on MDN\n* [`pointer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer) media feature documentation on MDN\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctet-stream%2Ftailwindcss-device","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctet-stream%2Ftailwindcss-device","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctet-stream%2Ftailwindcss-device/lists"}