Skip to content

Commit

Permalink
Add with-svelte-injected-style example (#63)
Browse files Browse the repository at this point in the history
* Add with-svelte-injected-style example

* Remove with-svelte-injected-style

* Implement injected styles
  • Loading branch information
JoacoEsteban authored Aug 26, 2024
1 parent ebb2888 commit 647818c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 0 additions & 6 deletions with-svelte/contents/plasmo-overlay.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.hw-top {
background: red;
color: white;
font-family: "Fascinate";
}

#plasmo-shadow-container {
width: 200px;
background-color: purple;
Expand Down
10 changes: 10 additions & 0 deletions with-svelte/contents/plasmo-overlay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@
</script>

<span class="hw-top">Every living thing wants to survive</span>

<style>
.hw-top {
background: red;
color: white;
font-family: "Fascinate";
width: 200px;
border: 8px solid aqua;
}
</style>
3 changes: 2 additions & 1 deletion with-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"description": "A basic Plasmo extension.",
"author": "Plasmo Corp. <[email protected]>",
"contributors": [
"louisgv"
"louisgv",
"joacoesteban"
],
"scripts": {
"dev": "plasmo dev",
Expand Down
5 changes: 4 additions & 1 deletion with-svelte/svelte.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import preprocess from "svelte-preprocess"
const config = {
preprocess: preprocess({
// ...svelte-preprocess options
})
}),
compilerOptions: {
css: 'injected', // this is the default mode
}
// ...other svelte options
}

Expand Down

0 comments on commit 647818c

Please sign in to comment.