Skip to content

Phoenix and Svelte component styles #28

Closed Answered by woutdp
terrisgit asked this question in Q&A
Discussion options

You must be logged in to vote

So <.button> uses a Phoenix component defined in core_components.ex. In svelte you'd use <button> which is the HTML tag for a button.

If you want to have parity between the 2, you'd need to create a Svelte component <Button> that works in the exact same way as the Phoenix component.

I can't see an immediate easy way of syncing up the styles.

One approach you can take is removing the tailwind styles from the core_components.ex and defining a global .button style which you then can apply on both the Svelte button and the Phoenix button. Then whenever you have a style change you only need to apply it in the .button class.

Another approach is to just copy each core_component and remake it in …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dev-guy
Comment options

Answer selected by woutdp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants