From aac674dc7dcfe2cfcc2b51a7f969810fe41e3ddf Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 1 Aug 2023 22:31:09 +0200 Subject: [PATCH] fix: Allow to properly include CSS in library builds by importing the CSS files This way we do not require any DOM environment to be present. Signed-off-by: Ferdinand Thiessen --- README.md | 11 +++++++++++ lib/appConfig.ts | 7 +++++++ lib/baseConfig.ts | 5 ----- lib/libConfig.ts | 21 ++++++++++++-------- lib/plugins/ImportCSS.ts | 41 +++++++++++++++++++++++++++++++++++++++ package-lock.json | 42 ++++++++++++++++++++++++++-------------- package.json | 1 + 7 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 lib/plugins/ImportCSS.ts diff --git a/README.md b/README.md index a42788ee..b4117eae 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,14 @@ export default createLibConfig({ }, }) ``` + +## Notes + +### Inlining / injecting CSS +You can enable inlining CSS code, but please note that this is handled differently for apps and libraries. + +For apps any styles can be injected in the JS by dynamically inject the styles in the document (creating `