Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-hyperform

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-hyperform

Rewrite CSS pseudo-classes into Hyperform classes

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Text “Hyperform - Insert Form” in 80s arcade game style

Rewrite CSS pseudo-classes into Hyperform classes

This PostCSS-Plugin allows you to convert advanced CSS pseudo-classes for form handling into their Hyperform counterparts.

Currently supported pseudo-classes and their transformation:

CSS selectorClass applied by Hyperform
:user-error.hf-validated.hf-invalid
:user-invalid.hf-validated.hf-invalid
:invalid.hf-invalid
:valid.hf-valid

Installation and Usage

Install via npm:

npm install postcss-hyperform

Then use it:

postcss([ require('postcss-hyperform') ])

This will transform this perfectly standards-conform code (that is, unfortunately, not fully supported by any browser as of 2016)

.input:valid {
  background: green;
}
.input:user-invalid {
  background: red;
}

into this stylesheet, that works like a charm, if you also happen to use Hyperform:

.input:valid, .input.hf-valid {
  background: green;
}
.input:user-invalid, .input.hf-validated.hf-invalid {
  background: red;
}

Problems and Todos

  • The specificity of :user-invalid is lower than that of the two replacement classes
  • Missing support for :in-range, :out-of-range, :required, :optional. They will be added when this accompanying issue is fixed.

Authors

Written by Manuel Strehl, based on code by Kevin Suttle.

License

This code is published under the terms of the MIT license.

FAQs

Package last updated on 21 Oct 2016

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