Coder Social home page Coder Social logo

iq-scm / ember-material-lite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mike-north/ember-material-lite

0.0 0.0 0.0 6.14 MB

Material Design Lite for Ember.js Apps

Home Page: http://mike.works/ember-material-lite

License: MIT License

Shell 0.28% JavaScript 65.59% HTML 2.44% Handlebars 30.25% SCSS 1.44%

ember-material-lite's Introduction

ember-material-lite

Build Status NPM Version

Google's Material Design Lite for Ember.js apps

This addon requires ember >= 1.11.0

Installation

# ember-cli < 0.2.3
ember install:addon ember-material-lite
# ember-cli >= 0.2.3
ember install ember-material-lite

Without SASS

This addon can be used without SASS (relying on pure CSS for styles). If you choose this path, you'll need to alter your app slightly.

  1. Delete the ember-cli-sass NPM dependency that the installation blueprint will add to your app.
  2. Add the following line to your ember-cli-build.js.
app.import('node_modules/material-design-lite/material.css');

Configuration

Colors

You can customize the colors of material design elements globally by setting sass variables prior to importing the main styles.

app/styles/app.scss

@import '_color-definitions';

$color-primary: $palette-teal-500;
$color-accent: $palette-pink-A200;

@import 'material-design-lite';

Load Material design icons fontfiles locally

Adding http://fonts.googleapis.com/icon?family=Material+Icons into the index.html just works. But in few scenarios(like running app offline) you would want to include these icon fonts from the project directories itself. To achieve the same, first edit ember-cli-build.js to include the following

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');
var pickFiles = require('broccoli-static-compiler');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    sassOptions: {
      includePaths: ['node_modules/material-design-lite/src']
    }
  });

  var googleFontFiles = pickFiles(
    'node_modules/material-design-icons/iconfont',
    {
      srcDir: '/',
      files: ['**/*.woff', '**/*.woff2', '**/*.eot', '**/*.ttf'],
      destDir: '/fonts'
    }
  );

  return mergeTrees([app.toTree(), googleFontFiles]);
};

Also Add below code on top of app/styles/app.scss file to import icon font files.

/*Material Icons css*/
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: local('Material Icons'), local('MaterialIcons-Regular'),
    url(../fonts/MaterialIcons-Regular.woff2) format('woff2'), url(../fonts/MaterialIcons-Regular.woff)
      format('woff'), url(../fonts/MaterialIcons-Regular.ttf) format('truetype');
}

Images

Several of the MDL components reference image assets. In order to include them in your project, edit ember-cli-build.js to include the following:

var mergeTrees = require('broccoli-merge-trees');
var pickFiles = require('broccoli-static-compiler');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    sassOptions: {
      includePaths: ['node_modules/material-design-lite/src']
    }
  });

  var materialSVG = pickFiles('node_modules/material-design-lite/src/images', {
    srcDir: '/',
    files: ['**/*.svg'],
    destDir: '/images'
  });

  return mergeTrees([app.toTree(), materialSVG]);
};

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Analytics

ember-material-lite's People

Contributors

batlefield avatar dustinfarris avatar ember-tomster avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hdra avatar jessepinho avatar kategengler avatar kennethkalmer avatar leoeuclids avatar mike-north avatar patrickberkeley avatar remkoboschker avatar renovate-bot avatar rmachielse avatar semantic-release-bot avatar trabus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.