-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ignore style tag inside script tag
- Loading branch information
1 parent
5a8cfa5
commit 1018345
Showing
3 changed files
with
35 additions
and
1 deletion.
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
15 changes: 15 additions & 0 deletions
15
packages/svelte2tsx/test/svelte2tsx/samples/style-in-script/expectedv2.ts
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 @@ | ||
///<reference types="svelte" /> | ||
;function render() { | ||
|
||
const config = { branding: { primaryColor: '#012345' } }, | ||
branding = config?.branding; | ||
|
||
const cssString = `<style>:root {--primary-color: ${ | ||
branding?.primaryColor ?? '#ABCDEF' | ||
};}</style>`; | ||
; | ||
async () => {}; | ||
return { props: /** @type {Record<string, never>} */ ({}), slots: {}, events: {} }} | ||
|
||
export default class Input__SvelteComponent_ extends __sveltets_2_createSvelte2TsxComponent(__sveltets_2_partial(__sveltets_2_with_any_event(render()))) { | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/svelte2tsx/test/svelte2tsx/samples/style-in-script/input.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,8 @@ | ||
<script> | ||
const config = { branding: { primaryColor: '#012345' } }, | ||
branding = config?.branding; | ||
const cssString = `<style>:root {--primary-color: ${ | ||
branding?.primaryColor ?? '#ABCDEF' | ||
};}</style>`; | ||
</script> |