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

CSS class position is overriden by internal inline style #841

Closed
insonifi opened this issue Jun 14, 2015 · 2 comments
Closed

CSS class position is overriden by internal inline style #841

insonifi opened this issue Jun 14, 2015 · 2 comments
Labels
customization: css Design CSS customizability package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.

Comments

@insonifi
Copy link

After update to version 0.8 I found, that my CSS styles no longer have effect on the components (e.g. position, transformation). I investigated, and found that most styles are overridden by inline styles somewhere within components. I can workaround this by using inline styles myself but hardly is a good practice.
Can you advice me how to apply custom CSS classes?

@mairh
Copy link

mairh commented Jun 14, 2015

@insonifi IMO there are 3 options you can override the inline styles:

  1. As you mentioned aplying inline styles directly to the components (which is not a good practice).
  2. Using classNames="your-class-name" and mark the properties as !important (again not a good practice)
  3. Write css in JS using any of the following options:

@hai-cea
Copy link
Member

hai-cea commented Jun 19, 2015

Thanks @mairh

@hai-cea hai-cea closed this as completed Jun 19, 2015
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. customization: css Design CSS customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: css Design CSS customizability package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

No branches or pull requests

5 participants