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 use this material-ui #276

Closed
victory-wu opened this issue Jan 24, 2015 · 5 comments
Closed

How to use this material-ui #276

victory-wu opened this issue Jan 24, 2015 · 5 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@victory-wu
Copy link

I won't NODEJS , How can I put him in my JAVA project ?

My environment is NGINX + TOMCAT ,

Repeatedly tested 1 day, Still don't succeed,

For example jquery-ui , bootstrap .... Only need to download -> import complete -> use

material-ui : download nodejs -> npm -> compile......x.xx.x.x.xx.x.x.x.xx.x.x..x

readme.md Not enough detailed , after npm install ? How to import to my project?

1, npm install material-ui
2, ?
Can you tell me the detailed steps?
Only need to command !
THANKS,

@eliquious
Copy link

There's nothing preventing you from using it with Java, but the tools require Node and NPM. You'll also need to use browserify if you want to use the React components. Once you have bundled all the libs, just add a script tag to your index.html file. Like so:

<script src="bundle.js"></script>

I hated Browserify at first. But the community's peer pressure is pretty strong... I still don't like it but a lot of libs require it these days. You can use a build tool like grunt or gulp to help aggregate all the vendor libs for you.

@victory-wu
Copy link
Author

1, npm install material-ui
2, ?
Can you tell me the detailed steps?
Only need to command !
THANKS,

@eliquious
Copy link

Do you want to use the React components as well or just the styles?

MaterialUI uses LESS so here are the steps just for using the styles:

  1. npm install material-ui less

  2. Create a main.less with the following:

    @import "node_modules/material-ui/src/less/scaffolding.less";
    
    //Define a custom less file to override any variables defined in scaffolding.less
    //@import "my-custom-overrides.less
    
    @import "node_modules/material-ui/src/less/components.less";
    
  3. lessc main.less > dist/main.css

  4. Update index.html with the following:

    <link rel="stylesheet" type="text/css" href="main.css">
    

If you want to use the React components you'll also need browserify.

@enriquecaballero
Copy link

Sure, the less is the easiest. But how does one compile all of the React components using Browserify?! I compile them within the lib directory using the index.js file but it only creates a require function. When I add the bundled script, it doesn't find the module. It is a bit ridiculous how there are no instructions whatsoever on bundling the React components without Node. Ridiculous.

@hai-cea
Copy link
Member

hai-cea commented Jun 18, 2015

Sorry you guys are having trouble. Unfortunately, we're using node for all of our dependency management. Maybe the solution is to provide a CDN build? Please see #262

@hai-cea hai-cea closed this as completed Jun 18, 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 support: question Community support but can be turned into an improvement and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

6 participants