-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes client:only CSS in Svelte components (#4782)
* Fixes client:only CSS in Svelte components * Add changeset
- Loading branch information
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes client:only CSS in Svelte components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...s/astro/test/fixtures/astro-client-only/src/components/PersistentCounterStandalone.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script> | ||
import './logResize'; | ||
let count = parseInt(localStorage.getItem('test:count')) || 0; | ||
$: localStorage.setItem('test:count', count); | ||
function add() { | ||
count += 1; | ||
} | ||
function subtract() { | ||
count -= 1; | ||
} | ||
</script> | ||
<style> | ||
button { | ||
background: tomato; | ||
} | ||
</style> | ||
<div class="counter"> | ||
<button on:click={subtract}>-</button> | ||
<pre>{ count }</pre> | ||
<button on:click={add}>+</button> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
packages/astro/test/fixtures/astro-client-only/src/pages/persistent-counter-standalone.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
import PersistentCounter from '../components/PersistentCounterStandalone.svelte'; | ||
--- | ||
<html> | ||
<head> | ||
<title>Client only pages - Only PersistentCounter, nothing else</title> | ||
</head> | ||
<body> | ||
<!-- | ||
Do not add another test-case to this file. This is meant to test if only a single component is used. | ||
--> | ||
|
||
<PersistentCounter client:only /> | ||
</body> | ||
</html> |