Socket
Socket
Sign inDemoInstall

fela-plugin-hover-media

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-hover-media

Fela plugin to wrap :hover styles in @media (hover: hover)


Version published
Weekly downloads
3.1K
increased by2.34%
Maintainers
1
Weekly downloads
 
Created
Source

fela-plugin-hover-media

npm version npm downloads Bundlephobia

Extracts all :hover styles and wrap them in a @media (hover: hover) media query.

It is inspired by postcss-hover-media-feature.

Why

This paragraph was copied from postcss-hover-media-feature and it perfectly answers the question.

Certain mobile browsers apply :hover styles on 'tap', which (in most cases) isn't desirable. By wrapping :hover styles with a Hover Media Feature media query these styles will only be applied on devices that support them.

Installation

yarn add fela-plugin-hover-media

You may alternatively use npm i --save fela-plugin-hover-media.

Usage

Make sure to read the documentation on how to use plugins.

import { createRenderer } from 'fela'
import hoverMedia from 'fela-plugin-hover-media'

const renderer = createRenderer({
  plugins: [hoverMedia()],
})

Example

Input
{
  color: "red",
  ':hover': {
    color: "blue"
  }
}
Output
{
  color: "red",
  '@media (hover: hover)': {
    ':hover': {
      color: "blue"
    }
  }
}

License

Fela is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @robinweser and all the great contributors.

Keywords

FAQs

Package last updated on 23 Feb 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc