Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Lit-style lowercase props #16

Closed
patricknelson opened this issue Jun 5, 2023 · 0 comments · Fixed by patricknelson/svelte-retag#9
Closed

Add support for Lit-style lowercase props #16

patricknelson opened this issue Jun 5, 2023 · 0 comments · Fixed by patricknelson/svelte-retag#9

Comments

@patricknelson
Copy link
Contributor

patricknelson commented Jun 5, 2023

For feature parity with Svelte 4.0 (and simply to enable the availability of uppercased props in custom element attributes), we should standardize on Lit-style attributes, per sveltejs/svelte#8457 (emphasis mine):

... and what the corresponding attribute for the property is (attribute, default lowercased prop name). These options are heavily inspired by lit: https://lit.dev/docs/components/properties.

e.g.

<custom-element foobar="baz></custom-element>

Where the element attribute foobar is automatically translated to its camelCase counterpart: fooBar, making it available in CustomElement.svelte as:

<script>
  export let fooBar = '';
</script>

<div>{fooBar}</div>

This should supersede the prior request to support kebab-style to camelCase conversions (issue #11), since that is apparently not the direction that Svelte 4 will be going. Sticking with Svelte's choice should make it easier for someone to migrate, if necessary. Just setting up this issue so I can track it and implement it when able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant