UNPKG

ckeditor5-dark-mode

Version:

Dark mode styles for CKEditor5 with shadcn variables

1 lines 1.96 kB
{"version":3,"file":"index.mjs","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/dark-mode-wrapper.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import \"../styles/dark-mode.css\";\nimport { ReactNode } from \"react\";\n\nconst CKEditorDarkModeWrapper = ({\n children,\n theme,\n}: {\n children?: ReactNode;\n theme: \"dark\" | \"light\";\n}) => {\n return <div className={`${theme === \"dark\" ? \"dark\" : \"\"}`}>{children}</div>;\n};\n\nexport default CKEditorDarkModeWrapper;\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","CKEditorDarkModeWrapper","_a","children","theme","_jsx","className"],"mappings":"yCAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAE,GAC9B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBU,CAqBxD,0zMCtBM,IAAAe,EAA0B,SAACC,OAC/BC,EAAQD,EAAAC,SACRC,EAAKF,EAAAE,MAKL,OAAOC,SAAKC,UAAW,UAAa,SAAVF,EAAmB,OAAS,IAAOD,SAAAA,GAC/D","x_google_ignoreList":[0]}