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

works with className="", but not with class="" #1

Open
trusktr opened this issue Jan 18, 2022 · 4 comments
Open

works with className="", but not with class="" #1

trusktr opened this issue Jan 18, 2022 · 4 comments

Comments

@trusktr
Copy link
Contributor

trusktr commented Jan 18, 2022

I've been taking solid-styled-jsx for a test run in porting an app from Vue to Solid (easy to copy/paste styles from <style scoped> to <style jsx> that way).

I'm encountering an issue where this template,

		return <div class="command">
			<h1>Foo</h1>
			<style jsx>{
				/*css*/ `
					h1 {
						margin-top: 5vh;
					}
				`
			}</style>
		</div>

produces this output in the DOM:

<div class="undefinedjsx-4071452694undefined">
  <h1 class="jsx-4071452694">Foo</h1>
</div>
@trusktr trusktr changed the title application of unique classes clashes with existing class names application of unique classes clashes with existing class names, or something? Jan 18, 2022
@trusktr
Copy link
Contributor Author

trusktr commented Jan 18, 2022

Not sure if it is clashing actually, because I tried moving my JSX class="command" to classList={{command: true}} but get the same output.

@trusktr
Copy link
Contributor Author

trusktr commented Jan 18, 2022

Using className="command" works!

@trusktr
Copy link
Contributor Author

trusktr commented Mar 28, 2022

@lxsmnsyc any chance you'd be willing to use your compiler chops to fix this?

@trusktr trusktr changed the title application of unique classes clashes with existing class names, or something? works with className="", but not with class="" Mar 28, 2022
@lxsmnsyc
Copy link
Member

@lxsmnsyc any chance you'd be willing to use your compiler chops to fix this?

solid-styled doesn't utilize classes to surgically add scoping so this is all good

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

No branches or pull requests

2 participants