Last active
November 21, 2016 13:33
-
-
Save diamondo25/f6432d45d4250d412a1d990731f59e8f to your computer and use it in GitHub Desktop.
Implement Materialize starter template into Ember (without ember-cli-materialize)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app/styles/app.scss | |
| @import "materialize"; | |
| // From http://materializecss.com/templates/starter-template/css/style.css | |
| .icon-block { | |
| padding: 0 15px; | |
| } | |
| .icon-block .material-icons { | |
| font-size: inherit; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*jshint node:true*/ | |
| /* global require, module */ | |
| var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
| module.exports = function(defaults) { | |
| var app = new EmberApp(defaults, { | |
| // Add options here | |
| sassOptions: { | |
| includePaths: [ | |
| 'bower_components/materialize/sass' | |
| ] | |
| } | |
| }); | |
| // Use `app.import` to add additional libraries to the generated | |
| // output files. | |
| // | |
| // If you need to use different assets in different | |
| // environments, specify an object as the first parameter. That | |
| // object's keys should be the environment name and the values | |
| // should be the asset to use in that environment. | |
| // | |
| // If the library that you are including contains AMD or ES6 | |
| // modules that you would like to import into your application | |
| // please specify an object with the list of modules as keys | |
| // along with the exports of each module as its value. | |
| // Main Materialize.js | |
| app.import({ | |
| development: 'bower_components/materialize/dist/js/materialize.js', | |
| production: 'bower_components/materialize/dist/js/materialize.min.js' | |
| }); | |
| // Roboto fonts | |
| const ROBOTO_VARIANTS = ['Thin', 'Light', 'Regular', 'Medium', 'Bold']; | |
| const ROBOTO_FONT_TYPES = ['woff2', 'woff', 'ttf', 'eot']; | |
| ROBOTO_VARIANTS.forEach(type => { | |
| ROBOTO_FONT_TYPES.forEach(extension => { | |
| app.import(`bower_components/materialize/fonts/roboto/Roboto-${type}.${extension}`, { destDir: 'fonts/roboto' }); | |
| }); | |
| }); | |
| return app.toTree(); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- app/index.html --> | |
| <!-- Add the following line under <link rel="stylesheet" href="{{rootURL}}assets/ember-quickstart.css"> --> | |
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create new ember application | |
| npm install -g [email protected] | |
| ember new ember-quickstart | |
| cd ember-quickstart | |
| # Install ember-cli-sass for including materialize sass component | |
| ember install ember-cli-sass | |
| bower install materialize | |
| # Create template files for template | |
| # Main wrapper template (with header and footer) | |
| ember generate template application | |
| # Main / template | |
| ember generate template index | |
| # Make sure the sass file exists | |
| touch app/styles/app.scss | |
| # Run server | |
| ember server |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will probably work, but you can also use https://github.com/mike-north/ember-materialize-shim ;)