From 9de62953ff25b797bd14c731fc3f79e941093dd9 Mon Sep 17 00:00:00 2001 From: "sumin.kim.717" Date: Fri, 19 Apr 2024 09:34:41 +0900 Subject: [PATCH] :sparkles: Change to online style for rsc --- .../obsidian-callouts-markdown/package.json | 1 - .../src/assets/styles/callouts.css | 15 -------- .../src/core/DefaultCallout.tsx | 7 ++-- .../obsidian-callouts-markdown/vite.config.ts | 2 -- yarn.lock | 36 ++++++++++++++----- 5 files changed, 31 insertions(+), 30 deletions(-) delete mode 100644 packages/obsidian-callouts-markdown/src/assets/styles/callouts.css diff --git a/packages/obsidian-callouts-markdown/package.json b/packages/obsidian-callouts-markdown/package.json index 2f01995..063a6b7 100644 --- a/packages/obsidian-callouts-markdown/package.json +++ b/packages/obsidian-callouts-markdown/package.json @@ -40,7 +40,6 @@ "test:coverage": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --coverage" }, "devDependencies": { - "vite-plugin-css-injected-by-js": "^3.4.0", "vite-plugin-dts": "^3.7.3" }, "peerDependencies": { diff --git a/packages/obsidian-callouts-markdown/src/assets/styles/callouts.css b/packages/obsidian-callouts-markdown/src/assets/styles/callouts.css deleted file mode 100644 index 25994e5..0000000 --- a/packages/obsidian-callouts-markdown/src/assets/styles/callouts.css +++ /dev/null @@ -1,15 +0,0 @@ -.callout-box { - padding: 1rem 1rem 0.625rem 1.5rem; - border-radius: 0.5rem; - margin: 0.5rem 0; -} - -.callout-title { - display: flex; - gap: 0.25rem; - font-weight: 600; -} - -.callout-body > p { - margin: 1rem 0; -} diff --git a/packages/obsidian-callouts-markdown/src/core/DefaultCallout.tsx b/packages/obsidian-callouts-markdown/src/core/DefaultCallout.tsx index 9ca3071..8325584 100644 --- a/packages/obsidian-callouts-markdown/src/core/DefaultCallout.tsx +++ b/packages/obsidian-callouts-markdown/src/core/DefaultCallout.tsx @@ -1,6 +1,5 @@ import {CalloutComponentProps} from '@/types/callout.ts'; import calloutOptions from '@/core/calloutOptions.ts'; -import '@/assets/styles/callouts.css'; import NoteIcon from '@/assets/icons/note.svg?react'; const DefaultCallout: React.FC = ({ @@ -14,12 +13,12 @@ const DefaultCallout: React.FC = ({ const Icon = typeof icon === 'function' ? icon : NoteIcon; return ( -
-
+
+

{title ?? type.charAt(0).toUpperCase() + type.slice(1)}

-
{children}
+
{children}
); }; diff --git a/packages/obsidian-callouts-markdown/vite.config.ts b/packages/obsidian-callouts-markdown/vite.config.ts index 1f43464..0f305e1 100644 --- a/packages/obsidian-callouts-markdown/vite.config.ts +++ b/packages/obsidian-callouts-markdown/vite.config.ts @@ -3,7 +3,6 @@ import react from '@vitejs/plugin-react'; import svgr from 'vite-plugin-svgr'; import tsconfigPaths from 'vite-tsconfig-paths'; import dts from 'vite-plugin-dts'; -import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'; // https://vitejs.dev/config/ export default defineConfig({ @@ -22,7 +21,6 @@ export default defineConfig({ react(), svgr(), dts({rollupTypes: true}), - cssInjectedByJsPlugin(), tsconfigPaths(), ], }); diff --git a/yarn.lock b/yarn.lock index ceee718..794003a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5196,7 +5196,16 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5222,7 +5231,14 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -5640,11 +5656,6 @@ vfile@^6.0.0: unist-util-stringify-position "^4.0.0" vfile-message "^4.0.0" -vite-plugin-css-injected-by-js@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.4.0.tgz#b09a571ab50744623736a4b056ecc85d7516311a" - integrity sha512-wS5+UYtJXQ/vNornsqTQxOLBVO/UjXU54ZsYMeX0mj2OrbStMQ4GLgvneVDQGPwyGJcm/ntBPawc2lA7xx+Lpg== - vite-plugin-dts@^3.7.3: version "3.7.3" resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-3.7.3.tgz#072ec78face3b76a7a492ffeb83469ef5318ce0b" @@ -5786,7 +5797,16 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==