This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=e(require("postcss-selector-parser"));const t=e=>{e=Object(e);const t=Boolean(!("preserve"in e)||e.preserve),r=String(e.replaceWith||".focus-visible"),o=s.default().astSync(r);return{postcssPlugin:"postcss-focus-visible",Rule(e,{result:r}){if(!e.selector.includes(":focus-visible"))return;let c;try{const t=s.default((e=>{e.walkPseudos((e=>{":focus-visible"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(o.clone({})))}))})).processSync(e.selector);c=String(t)}catch(s){return void e.warn(r,`Failed to parse selector : ${e.selector}`)}if(void 0===c)return;if(c===e.selector)return;const l=e.clone({selector:c});t?e.before(l):e.replaceWith(l)}}};t.postcss=!0,module.exports=t;

View File

@@ -0,0 +1,6 @@
import type { PluginCreator } from 'postcss';
declare const creator: PluginCreator<{
preserve?: boolean;
replaceWith?: string;
}>;
export default creator;

View File

@@ -0,0 +1 @@
import e from"postcss-selector-parser";const s=s=>{s=Object(s);const r=Boolean(!("preserve"in s)||s.preserve),t=String(s.replaceWith||".focus-visible"),o=e().astSync(t);return{postcssPlugin:"postcss-focus-visible",Rule(s,{result:t}){if(!s.selector.includes(":focus-visible"))return;let c;try{const r=e((e=>{e.walkPseudos((e=>{":focus-visible"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(o.clone({})))}))})).processSync(s.selector);c=String(r)}catch(e){return void s.warn(t,`Failed to parse selector : ${s.selector}`)}if(void 0===c)return;if(c===s.selector)return;const l=s.clone({selector:c});r?s.before(l):s.replaceWith(l)}}};s.postcss=!0;export{s as default};