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

How to disable Amplify from loading its Auth CSS theme file in a React app? #2691

Closed
j0b0sapi3n opened this issue Feb 12, 2019 · 7 comments
Closed
Assignees
Labels
Build Related to build issues feature-request Request a new feature React React related issues UI Related to UI Components

Comments

@j0b0sapi3n
Copy link

** Which Category is your question related to? **
Auth theme CSS files

** What AWS Services are you utilizing? **
aws-amplify-react within a React app

** Provide additional details e.g. code snippets **
I'm using Amplify in my React app. For Auth I don't use any of the provided UI and just use it programmatically through its provided state changes to interact with Cognito. I hide the default components and provide my own theme object (which basically sets everything to null).

<Authenticator hideDefault={true} onStateChange={this.handleAuthStateChange} theme={theme}>

However, I still see that even after I build my react app for production the CSS theme file that comes with Amplify Auth UI gets loaded in. How do I completely disable this CSS from being included? I'm trying to cut down my deployed file sizes as much as possible. Thanks!

@manueliglesias manueliglesias added question General question Build Related to build issues React React related issues labels Feb 13, 2019
@jordanranz jordanranz self-assigned this Feb 13, 2019
@jordanranz
Copy link
Contributor

Hey @j0b0sapi3n,

This is currently not possible to do but this seems like a necessary enhancement. I'll investigate how we can make this happen.

@jordanranz jordanranz added this to the UI Components refactor milestone Mar 11, 2019
@jordanranz
Copy link
Contributor

This will be a part of our UI Component refactor. I will keep this issue open so we can track this request.

@nypinstripes
Copy link

Hey @jordanranz also removing any !important flags, thanks.

@powerful23 powerful23 added feature-request Request a new feature and removed enhancement question General question labels May 6, 2019
@jordanranz
Copy link
Contributor

FYI, we have started an RFC discussion for a proposed Amplify UI Component refactor to increase customizability and flexibility for our components. Please feel free to add any additional comments to the following issue:

#3279

@nagey
Copy link

nagey commented Apr 23, 2020

Would be really great here if the imported styles avoided the use of global color variables that don't carry any sort of namespacing…

For example, a color named --amplifyGrey is a lot better than one named --grey

@thathurtabit
Copy link

Encouraging that this seems to be being worked on. Just being able to remove all CSS i.e. pass a theme={false} prop would save hours / days of tedious and confusing CSS overrides.

@abdallahshaban557 abdallahshaban557 added the UI Related to UI Components label Jun 3, 2022
@tannerabread
Copy link
Contributor

Closing as this should now be possible or will be handled in the UI repo. Theming is possible with the current React Authenticator component as shown here and Auth methods can be used directly without the supplied components as shown here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Related to build issues feature-request Request a new feature React React related issues UI Related to UI Components
Projects
None yet
Development

No branches or pull requests

9 participants