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

css-blank-pseudo

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-blank-pseudo - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

browser-legacy.js

2

browser.js

@@ -1,1 +0,1 @@

function cssBlankPseudo(e,t){var r=Object(t).className,n=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}c(HTMLInputElement),c(HTMLSelectElement),c(HTMLTextAreaElement);var a="input,select,textarea";function s(){this.value?(n&&this.removeAttribute(n),r&&this.classList.remove(r),this.removeAttribute("blank")):(n&&this.setAttribute("blank",n),r&&this.classList.add(r))}function c(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),r=t.set;t.set=function(e){r.apply(this,arguments),s.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll(a),function(e){e.addEventListener("input",s),s.call(e)}),new MutationObserver(function(e){e.forEach(function(e){e.addedNodes&&e.addedNodes.forEach(function(e){1===e.nodeType&&e.matches(a)&&(e.addEventListener("input",s),s.call(e))}),e.removedNodes&&e.removedNodes.forEach(function(e){1===e.nodeType&&e.matches(a)&&e.removeEventListener("input",s)})})}).observe(e,{childList:!0,subtree:!0})}
function cssBlankPseudo(e,t){var r=Object(t).className,n=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}var a=(e.ownerDocument||e).defaultView;i(a.HTMLInputElement),i(a.HTMLSelectElement),i(a.HTMLTextAreaElement);var c="input,select,textarea";function s(){this.value?(n&&this.removeAttribute(n),r&&this.classList.remove(r),this.removeAttribute("blank")):(n&&this.setAttribute("blank",n),r&&this.classList.add(r))}function i(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),r=t.set;t.set=function(e){r.apply(this,arguments),s.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll(c),function(e){e.addEventListener("input",s),s.call(e)}),new MutationObserver(function(e){e.forEach(function(e){e.addedNodes&&e.addedNodes.forEach(function(e){1===e.nodeType&&e.matches(c)&&(e.addEventListener("input",s),s.call(e))}),e.removedNodes&&e.removedNodes.forEach(function(e){1===e.nodeType&&e.matches(c)&&e.removeEventListener("input",s)})})}).observe(e,{childList:!0,subtree:!0})}
# Changes to CSS Blank Pseudo
### 0.1.2 (November 17, 2018)
- Provide a version specifically for Internet Explorer 11
### 0.1.1 (November 17, 2018)

@@ -4,0 +8,0 @@

@@ -20,5 +20,6 @@ 'use strict';

observeValueOfHTMLElement(HTMLInputElement);
observeValueOfHTMLElement(HTMLSelectElement);
observeValueOfHTMLElement(HTMLTextAreaElement); // form control elements selector
const window = (document.ownerDocument || document).defaultView;
observeValueOfHTMLElement(window.HTMLInputElement);
observeValueOfHTMLElement(window.HTMLSelectElement);
observeValueOfHTMLElement(window.HTMLTextAreaElement); // form control elements selector

@@ -25,0 +26,0 @@ const selector = 'input,select,textarea'; // conditionally update all form control elements

{
"name": "css-blank-pseudo",
"version": "0.1.1",
"version": "0.1.2",
"description": "Style form elements when they are empty",

@@ -17,2 +17,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>",

"browser.js",
"browser-legacy.js",
"cli.js",

@@ -23,2 +24,6 @@ "index.js",

"index.mjs.map",
"legacy.js",
"legacy.js.map",
"legacy.mjs",
"legacy.mjs.map",
"postcss.js",

@@ -31,6 +36,6 @@ "postcss.js.map",

"build": "npm run build:browser && npm run build:cli && npm run build:node && npm run build:postcss",
"build:browser": "cross-env NODE_ENV=browser rollup -c .rollup.js --silent",
"build:browser": "cross-env NODE_ENV=browser rollup -c .rollup.js --silent && cross-env NODE_ENV=browser:legacy rollup -c .rollup.js --silent",
"build:cli": "cross-env NODE_ENV=cli rollup -c .rollup.js --silent",
"build:postcss": "cross-env NODE_ENV=postcss rollup -c .rollup.js --silent",
"build:node": "rollup -c .rollup.js --silent",
"build:node": "rollup -c .rollup.js --silent && cross-env NODE_ENV=legacy rollup -c .rollup.js --silent",
"prepublishOnly": "npm build && npm test",

@@ -37,0 +42,0 @@ "pretest": "npm run build:postcss",

@@ -36,5 +36,15 @@ # CSS Blank Pseudo [<img src="http://jonathantneal.github.io/js-logo.svg" alt="" width="90" height="90" align="right">][CSS Blank Pseudo]

That’s it. The script is 483 bytes and works in all browsers, as far back as
Internet Explorer 11.
That’s it. The script is 509 bytes and works in all browsers.
---
If you support Internet Explorer 11, use the **browser legacy** script, which
is 671 bytes:
```html
<link rel="stylesheet" href="TRANSFORMED.css">
<script src="https://unpkg.com/css-blank-pseudo/browser-legacy"></script>
<script>cssBlankPseudo(document)</script>
```
## How it works

@@ -41,0 +51,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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