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

postcss-substitute-optional-required

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-substitute-optional-required

PostCSS plugin to shim the pseudo-selectors :required and :optional by using negation (:not) and therefore increase their browser support.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

PostCSS Substitute Optional Required Build Status [dependencies] (https://david-dm.org/MattDiMu/postcss-substitute-optional-required) devDependencies

PostCSS plugin to shim the pseudo-selectors :required and :optional by using negation (:not) and therefore slightly increase their browser support.

/* input */
input:required::after {
    content: '*'
}
textarea:optional::after {
    content: '(optional)';
}

/* output */
input:not(:optional),
input:required::after {
    content: '*'
}

textarea:not(:required)::after,
textarea:optional::after {
    content: '(optional)';
}
/* input, option { method: 'shim-required' } */
:required {
    color: hotpink;
}
:optional {
    color: indianred;
}
/* output, option { method: 'shim-required' } */
:not(:optional),
:required {
    color: hotpink;
}
:optional {
    color: indianred;
}
/* input, option { method: 'shim-optional' } */
:required {
    color: hotpink;
}
:optional {
    color: indianred;
}
/* output, option { method: 'shim-optional' } */
:required {
    color: hotpink;
}
:not(:required),
:optional {
    color: indianred;
}

##Options The only available option is method, with the possible values shim-all (default), shim-optional and shim-required:

Usage

postcss([ require('postcss-substitute-optional-required') ])
postcss([ require('postcss-substitute-optional-required') ])({ method: 'shim-required' }) //shim only the :required selector

See PostCSS docs for examples for your environment.

Keywords

FAQs

Package last updated on 20 May 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