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

css-blank-pseudo

Package Overview
Dependencies
Maintainers
3
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 6.0.1 to 6.0.2

12

CHANGELOG.md
# Changes to CSS Blank Pseudo
### 6.0.2
_April 18, 2024_
- Fix: Do not throw when a html select has the attribute "multiple" set.
### 6.0.1

@@ -15,8 +21,2 @@

### 5.0.2
_February 6, 2023_
- Reduce the amount of duplicate fallback CSS.
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo/CHANGELOG.md)

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

!function(){var e=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(t){for(var n=!0,o=0,r=e.length;o<r&&n;o++)t.indexOf(e[o])>-1&&(n=!1);return n}var t="js-blank-pseudo";function isFormControlElement(e){return"INPUT"===e.nodeName||"SELECT"===e.nodeName||"TEXTAREA"===e.nodeName}function createNewEvent(e){var t;return"function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),t}function observeValueOfHTMLElement(e,t){var n=Object.getOwnPropertyDescriptor(e.prototype,"value"),o=n.set;n.set=function set(){o.apply(this,arguments),t({target:this})},Object.defineProperty(e.prototype,"value",n)}function cssBlankPseudoInit(e){var n={force:!1,replaceWith:"[blank]"};if(void 0!==e&&"force"in e&&(n.force=e.force),void 0!==e&&"replaceWith"in e&&(n.replaceWith=e.replaceWith),!isValidReplacement(n.replaceWith))throw new Error(n.replaceWith+" is not a valid replacement since it can't be applied to single elements.");try{if(document.querySelector(":blank"),!n.force)return}catch(m){}var o,r,a,i,c,l,d,s=("."===(o=n.replaceWith)[0]?(r=o.slice(1),a=function remove(e){return e.classList.remove(r)},i=function add(e){return e.classList.add(r)}):(r=o.slice(1,-1),a=function remove(e){return e.removeAttribute(r,"")},i=function add(e){return e.setAttribute(r,"")}),function handleInputOrChangeEvent(e){var t=e.target;isFormControlElement(t)&&(("SELECT"===t.nodeName?t.options[t.selectedIndex].value:t.value)?a(t):i(t))}),u=function bindEvents(){document.body&&(document.body.addEventListener("change",s),document.body.addEventListener("input",s))},f=function updateAllCandidates(){Array.prototype.forEach.call(document.querySelectorAll("input, select, textarea"),(function(e){s({target:e})}))};if(document.body?u():window.addEventListener("load",u),-1===document.documentElement.className.indexOf(t)&&(document.documentElement.className+=" "+t),observeValueOfHTMLElement(self.HTMLInputElement,s),observeValueOfHTMLElement(self.HTMLSelectElement,s),observeValueOfHTMLElement(self.HTMLTextAreaElement,s),c=self.HTMLOptionElement,l=Object.getOwnPropertyDescriptor(c.prototype,"selected"),d=l.set,l.set=function set(e){d.apply(this,arguments);var t=createNewEvent("change");this.parentElement.dispatchEvent(t)},Object.defineProperty(c.prototype,"selected",l),f(),"undefined"!=typeof self.MutationObserver)new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&isFormControlElement(e)&&s({target:e})}))}))})).observe(document,{childList:!0,subtree:!0});else{var p=function handleOnLoad(){return f()};window.addEventListener("load",p),window.addEventListener("DOMContentLoaded",p)}}("object"==typeof window&&window||"object"==typeof self&&self||{}).cssBlankPseudoInit=cssBlankPseudoInit}();
!function(){var e=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(t){for(var n=!0,o=0,r=e.length;o<r&&n;o++)t.indexOf(e[o])>-1&&(n=!1);return n}var t="js-blank-pseudo";function isFormControlElement(e){return"INPUT"===e.nodeName||"SELECT"===e.nodeName||"TEXTAREA"===e.nodeName}function createNewEvent(e){var t;return"function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),t}function observeValueOfHTMLElement(e,t){var n=Object.getOwnPropertyDescriptor(e.prototype,"value"),o=n.set;n.set=function set(){o.apply(this,arguments),t({target:this})},Object.defineProperty(e.prototype,"value",n)}function cssBlankPseudoInit(e){var n={force:!1,replaceWith:"[blank]"};if(void 0!==e&&"force"in e&&(n.force=e.force),void 0!==e&&"replaceWith"in e&&(n.replaceWith=e.replaceWith),!isValidReplacement(n.replaceWith))throw new Error(n.replaceWith+" is not a valid replacement since it can't be applied to single elements.");try{if(document.querySelector(":blank"),!n.force)return}catch(m){}var o,r,a,i,c,l,d,s=("."===(o=n.replaceWith)[0]?(r=o.slice(1),a=function remove(e){return e.classList.remove(r)},i=function add(e){return e.classList.add(r)}):(r=o.slice(1,-1),a=function remove(e){return e.removeAttribute(r,"")},i=function add(e){return e.setAttribute(r,"")}),function handleInputOrChangeEvent(e){var t,n=e.target;isFormControlElement(n)&&(("SELECT"===n.nodeName?null!=(t=n.options[n.selectedIndex])&&t.value:n.value)?a(n):i(n))}),u=function bindEvents(){document.body&&(document.body.addEventListener("change",s),document.body.addEventListener("input",s))},f=function updateAllCandidates(){Array.prototype.forEach.call(document.querySelectorAll("input, select, textarea"),(function(e){s({target:e})}))};if(document.body?u():window.addEventListener("load",u),-1===document.documentElement.className.indexOf(t)&&(document.documentElement.className+=" "+t),observeValueOfHTMLElement(self.HTMLInputElement,s),observeValueOfHTMLElement(self.HTMLSelectElement,s),observeValueOfHTMLElement(self.HTMLTextAreaElement,s),c=self.HTMLOptionElement,l=Object.getOwnPropertyDescriptor(c.prototype,"selected"),d=l.set,l.set=function set(e){d.apply(this,arguments);var t=createNewEvent("change");this.parentElement.dispatchEvent(t)},Object.defineProperty(c.prototype,"selected",l),f(),"undefined"!=typeof self.MutationObserver)new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&isFormControlElement(e)&&s({target:e})}))}))})).observe(document,{childList:!0,subtree:!0});else{var p=function handleOnLoad(){return f()};window.addEventListener("load",p),window.addEventListener("DOMContentLoaded",p)}}("object"==typeof window&&window||"object"==typeof self&&self||{}).cssBlankPseudoInit=cssBlankPseudoInit}();
//# sourceMappingURL=browser-global.js.map
{
"name": "css-blank-pseudo",
"description": "Style form elements when they are empty",
"version": "6.0.1",
"version": "6.0.2",
"contributors": [

@@ -71,3 +71,3 @@ {

"type": "git",
"url": "https://github.com/csstools/postcss-plugins.git",
"url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/css-blank-pseudo"

@@ -74,0 +74,0 @@ },

# PostCSS Blank Pseudo [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
[<img alt="npm version" src="https://img.shields.io/npm/v/css-blank-pseudo.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/blank-pseudo-class.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
[<img alt="npm version" src="https://img.shields.io/npm/v/css-blank-pseudo.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/blank-pseudo-class.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/blank-pseudo-class.svg" height="20">][css-url]

@@ -152,3 +152,3 @@ ```bash

<!-- When using a CDN url you will have to manually update the version number -->
<script src="https://unpkg.com/css-blank-pseudo@6.0.1/dist/browser-global.js"></script>
<script src="https://unpkg.com/css-blank-pseudo@6.0.2/dist/browser-global.js"></script>
<script>cssBlankPseudoInit()</script>

@@ -155,0 +155,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

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

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