Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
tailwindcss-device
Advanced tools
TailwindCSS plugin to add variants for input device detection using `@media` queries
TailwindCSS plugin to add variants for input device detection using @media
queries
pnpm
pnpm add -D tailwindcss-device
npm
npm i -D tailwindcss-device
yarn
yarn add -D tailwindcss-device
tailwind.config.js
plugins section:const device = require("tailwindcss-device")
module.exports = {
plugins: [
device,
// ...
// or with custom prefix:
deivce({prefix: "device"})
]
}
<div class="border border-black rounded-md device-touch:rounded-lg">
<div class="hidden device-touch:block">
Hello, I'm visible on smartphones and tables!
</div>
<div class="hidden device-desktop:block">
Hello, I'm visible on computer with mouse!
</div>
<div>
.hidden {
display: none;
}
@media (pointer: coarse) {
.device-touch\:block {
display: block;
}
}
@media (pointer: fine) or (pointer: none) {
.device-desktop\:block {
display: block;
}
}
Name | Target |
---|---|
touch | Devices with touchscreen as primary input method (e.g smartphones and tablets) |
desktop | Computers with a mouse |
desktop-touch | Computers with touch input device |
desktop-any | Computers with or without touch input device |
any-pointer
media feature documentation on MDNpointer
media feature documentation on MDN0.3.0
5d0d342
Thanks @octet-stream! - Drop Node 16. Minimal required version is 18 from now on.
5d0d342
Thanks @octet-stream! - Use tsup instead of microbundle to build project. This allows to generate proper and separate set of types for cjs and esm output.
FAQs
TailwindCSS plugin to add variants for input device detection using `@media` queries
The npm package tailwindcss-device receives a total of 6 weekly downloads. As such, tailwindcss-device popularity was classified as not popular.
We found that tailwindcss-device demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.