marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.94k stars 5.24k forks source link

Document how to change JSS insertion point. #2940

Closed ghost closed 5 years ago

ghost commented 5 years ago

Is your feature request related to a problem? Please describe. I know that the JSS insertion point can be changed, but I'm not sure how. React-admin is using an older version of material-ui and the techniques described in their latest docs don't work here. I also tried running jss.setup myself.

I don't even see how React-Admin is initializing JSS at all. It's a direct dependency of ra-ui-materialui but nothing in that package even imports jss or react-jss. I can't find the words jss anywhere in your packages.

Describe the solution you'd like I'd like a support document describing how to do it. Or, just give the answer here if possible and that can serve as the documentation for now...

Describe alternatives you've considered Continuing to try and figure it out myself. So far I've spent over an hour trying the wrong solutions. I might get lucky.

Additional context I really don't want to have to write !important next to every rule in every stylesheet! Thanks.

oliviertassinari commented 5 years ago

Related to https://github.com/mui-org/material-ui/issues/7944#issuecomment-468042637

ghost commented 5 years ago

@oliviertassinari No more quick comebacks eh? I know, it's embarrassing getting murdered by words...

Maybe next time if you ask nicely I'll show you 15 years worth of monetary contributions to various open source foundations made by my company. That's what your pal was desperately asking for with his ads right?

Thanks for banning me because I'd never use MUI on purpose and I'd hate to accidentally contribute. Honestly, I think it would be great if some users didn't contribute anything. Work harder on that, ok?

oliviertassinari commented 5 years ago

@waynebloss I don't know who banned you, it surely wasn't me. They are 16 people in the Material-UI organization.

ghost commented 5 years ago

@oliviertassinari I couldn't care less about the banning. You have no foundation to look at my life for 5 seconds and say I don't contribute. I had a beef with the other guy and I said some things against him, not sure why you were white knighting but ok.

Water, bridge. Let's move on.

ghost commented 5 years ago

Anywhoo - well I haven't found a way to change the JSS insert point after working on this for 3 hours.

I think I wasted half of that trying things that weren't meant for v1.5.1 of MUI before I made this issue.

I'm going to have to pull apart all these packages later and see what's going on. Will update this issue with the answer if and when I can find it.

oliviertassinari commented 5 years ago

The solutions shared in https://material-ui.com/customization/css-in-js/#css-injection-order should be working with v1.5.1. Here is a live example: https://codesandbox.io/s/my8wpl0p1x.

oliviertassinari commented 5 years ago

@waynebloss You might like this one… https://twitter.com/olivtassinari/status/1098541740846399488

ghost commented 5 years ago

OK, I gave up on MUI docs after none of the solutions listed here worked - https://material-ui.com/css-in-js/advanced/

Now I see what's going on, those are for MUI 4.

oliviertassinari commented 5 years ago

https://material-ui.com/css-in-js/*

Yes, this section is for v4, it won't help.

ghost commented 5 years ago

Very good thanks. Glad we could get this resolved with minimum bloodshed!

The proper contraption to setup the insertion point is finally in place and we know where the exact documentation is.

@fzaninotto Perhaps just a link to that page should be added to the docs. I'm actually fine with searching issues to learn things; I do it all the time. Up to you. If you want me to decide where in the docs this should go and how much to say about it - I can certainly do that. Just let me know, thanks!

@oliviertassinari I actually don't see any of those ads on the Vue page. Doh!

ghost commented 5 years ago

Also, extra thanks to @oliviertassinari for finding the solution even after sparring verbally with me.

To sum up this minor drama for any interested readers:

kof commented 5 years ago

The drama is that people like you are big damage to our community.

You didn't care to look up that the postinstall hint was already removed a long time before you opened that issue, it was already discussed.

You didn't care to ask why we added it in the first place.

You didn't care that many other very popular projects do that as well, for example, preact, and 99,999999% of people don't get offended by this.

You are using my time and my mental health to express your damaged and hostile attitude towards open source and essentially to other people work, where many people like me invest their PERSONAL time.

If I would be a maintainer in this organization, I would ban you here as well after what you did there https://github.com/cssinjs/jss/issues/1013

djhi commented 5 years ago

@waynebloss. We won't tolerate this behavior and language here. This will be the only warning before ban.

fzaninotto commented 5 years ago

I'm closing this issue as it's a material-ui issue IMO. Thanks @oliviertassinari for chiming it and staying cool.