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

Allow the complete selection of custom CSS classes #194

Open
2 tasks done
Alfred-Mountfield opened this issue Jul 15, 2023 · 2 comments
Open
2 tasks done

Allow the complete selection of custom CSS classes #194

Alfred-Mountfield opened this issue Jul 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Alfred-Mountfield
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The library allows the setting of custom class names for components, however the implementation is limited in the properties that they can overwrite. I am using Tailwind CSS similar to #94 (although I am using Svelte) and even with appearance.extend: false I am unable to easily style the buttons to match the rest of my application.

There are still a host of styling properties that are applied which overwrite ones I try and set through appearance.className:
image

This is greatly hurting the ergonomics as I'm having to set an !important modifier on my properties to actually be able to override them (such as removing the border), which in turn makes it hard for me to re-use my button styling from the rest of my application (where I do not want to use !important).

To Reproduce

  1. Insert Auth into a svelte application
  2. Disable the default theme and try and customise the appearance
  3. Try and use className to create a button style that includes things such as padding: 1rem and note that they are not applied (Note: using a theme such as theme: ThemeSupa will apply its own padding due to setting the variables)

Expected behavior

I would expect the CSS properties I set to actually additively apply to the element, but perhaps there should be an option to remove all styling from the elements and only apply the class name

Screenshots

image
	<Auth
		{supabaseClient}
		providers={['google']}
		{redirectTo}
		{view}
		showLinks={false}
		theme="dark"
		appearance={{
			extend: false,
			className: {
				button: 'button-base button-primary',
			}
		}}
		additionalData={{}}
	/>

System information

  • OS: macOS
  • Browser (if applies): chrome
  • Version of supabase-js @supabase/auth-ui-shared: 0.1.6
  • Version of supabase-js @supabase/auth-ui-svelte: 0.2.2
  • Version of Node.js: 18.6.1

Additional context

N/A

@Alfred-Mountfield Alfred-Mountfield added the bug Something isn't working label Jul 15, 2023
@johnmdonich
Copy link

@Alfred-Mountfield, did you ever find a workaround for this? I have the same issue.

@Alfred-Mountfield
Copy link
Author

Aside from marking classes as important, I didn't find another easy way around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants