All Projects → arabsight → aurelia-mdl-plugin

arabsight / aurelia-mdl-plugin

Licence: MIT license
Material Design Lite plugin for Aurelia.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aurelia-mdl-plugin

aurelia-virtual-scroll
Aurelia Virtual Scroller
Stars: ✭ 15 (-21.05%)
Mutual labels:  aurelia, aurelia-plugins
aurelia-knockout
Adds support for Knockout binding syntax to make transition from Durandal and Knockout to Aurelia simpler.
Stars: ✭ 22 (+15.79%)
Mutual labels:  aurelia, aurelia-plugins
aurelia-mdc-plugin
MDC (Material Design UI Components) plugin for Aurelia.
Stars: ✭ 13 (-31.58%)
Mutual labels:  aurelia, aurelia-plugins
aurelia-fontawesome
Font Awesome 5 Aurelia component
Stars: ✭ 15 (-21.05%)
Mutual labels:  aurelia, aurelia-plugins
Servicestackvs
ServiceStackVS - Visual Studio extension for ServiceStack
Stars: ✭ 117 (+515.79%)
Mutual labels:  aurelia
Aurelia Google Analytics
An Aurelia.io plugin that adds Google Analytics page tracking to your project.
Stars: ✭ 28 (+47.37%)
Mutual labels:  aurelia
Slim.js
Fast & Robust Front-End Micro-framework based on modern standards
Stars: ✭ 789 (+4052.63%)
Mutual labels:  aurelia
Cli
The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
Stars: ✭ 401 (+2010.53%)
Mutual labels:  aurelia
aurelia-dotnet-template
A starting point for new dotnet projects using the aurelia-framework with typescript and webpack.
Stars: ✭ 13 (-31.58%)
Mutual labels:  aurelia
Aurelia Ui Framework
A bespoke UI Framework built on Aurelia for desktop business application
Stars: ✭ 155 (+715.79%)
Mutual labels:  aurelia
Aurelia Slickgrid
Aurelia-Slickgrid a wrapper of the lightning fast & customizable SlickGrid datagrid with a few Styling Themes
Stars: ✭ 100 (+426.32%)
Mutual labels:  aurelia
Aurelia Store Examples
Aurelia Store Plugin examples
Stars: ✭ 29 (+52.63%)
Mutual labels:  aurelia
Aurelia Kendoui Bridge
Stars: ✭ 120 (+531.58%)
Mutual labels:  aurelia
Bcx Aurelia Dnd
Aurelia Drag and Drop.
Stars: ✭ 20 (+5.26%)
Mutual labels:  aurelia
Aurelia Realworld Example App
Exemplary real world application built with Aurelia
Stars: ✭ 183 (+863.16%)
Mutual labels:  aurelia
Nswag
The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
Stars: ✭ 4,825 (+25294.74%)
Mutual labels:  aurelia
Aurelia Toolbelt
A bunch of components from bootstrap 4, jquery and vanilla js for Aurelia framework
Stars: ✭ 63 (+231.58%)
Mutual labels:  aurelia
Generator Spfx
Open-source generator to extend the capabilities of the Microsoft SPFx generator
Stars: ✭ 150 (+689.47%)
Mutual labels:  aurelia
Sqlformat
.NET SQL Parser and Formatter Tool and SSMS Plugin
Stars: ✭ 49 (+157.89%)
Mutual labels:  aurelia
Aurelia
Aurelia 2, a standards-based, front-end framework designed for high-performing, ambitious applications.
Stars: ✭ 995 (+5136.84%)
Mutual labels:  aurelia

Material Design Lite plugin for Aurelia. CLI DEMO

NPM

Usage

With jspm:

jspm install material-design-lite
jspm install aurelia-mdl-plugin
  • Register the plugin:
import 'material-design-lite/material';

export function configure(aurelia) {
    ...
    aurelia.use.plugin('aurelia-mdl-plugin');
    ...
}
  • Load mdl CSS:
<template>
    <require from="material-design-lite/material.css"></require>
    ...
    <!-- give it a try -->
    <button
        class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"
    >
        Button
    </button>
</template>

With Aurelia CLI:

  • Install:
npm i material-design-lite aurelia-mdl-plugin
  • Configure aurelia.json:

add mdl & plugin to one of your bundle's dependencies.

({
    "name": "material-design-lite",
    "path": "../node_modules/material-design-lite/dist",
    "main": "material",
    "resources": ["material.css"]
},
{
    "name": "aurelia-mdl-plugin",
    "path": "../node_modules/aurelia-mdl-plugin/dist/amd",
    "main": "index"
})
  • Register the plugin:
import 'material-design-lite';
export function configure(aurelia) {
    ...
    aurelia.use.plugin('aurelia-mdl-plugin');
    ...
}
  • require css file the same way.
  • if you want to use another color theme:

change the resources key:

"resources": [
    "material.deep_orange-blue.min.css"
]

import the css:

<require
    from="material-design-lite/material.deep_orange-blue.min.css"
></require>

Configure the plugin

  • manual upgrade:

the plugin looks for specific mdl components and adds a custom attribute for each one automatically. If for some reason you don't want to auto upgrade you can change that when registering the plugin:

aurelia.use.plugin("aurelia-mdl-plugin", (m) => m.autoUpgrade(false));

this way you need to add 'mdl-target' custom attribute manually to every component that needs upgrading.

  • upgrading other components:

if you want to upgrade other components like custom mdl components you can register them like this:

aurelia.use.plugin("aurelia-mdl-plugin", (m) =>
    m.addClasses("mdl-custom-one", "two")
);
  • example: using mdl-selectfield with aurelia cli:

aurelia.json:

({
    "name": "material-design-lite",
    "path": "../node_modules/material-design-lite/dist",
    "main": "material",
    "resources": ["material.css"]
},
{
    "name": "mdl-selectfield",
    "path": "../node_modules/mdl-selectfield/dist",
    "main": "mdl-selectfield",
    "resources": ["mdl-selectfield.css"]
},
{
    "name": "aurelia-mdl-plugin",
    "path": "../node_modules/aurelia-mdl-plugin/dist/amd",
    "main": "index"
})

config:

import 'material-design-lite';
import 'mdl-selectfield';
export function configure(aurelia) {
    ...
    aurelia.use.
        plugin('aurelia-mdl-plugin', mdl => {
            mdl.addClasses('mdl-js-selectfield');
        });
    ...
}

require css in html:

<require from="material-design-lite/material.css"></require>
<require from="mdl-selectfield/mdl-selectfield.css"></require>

<div class="mdl-selectfield mdl-js-selectfield">
    <select id="gender" class="mdl-selectfield__select">
        <option value=""></option>
        <option value="option1">option 1</option>
        <option value="option2">option 2</option>
    </select>
    <label class="mdl-selectfield__label" for="gender">User gender</label>
    <span class="mdl-selectfield__error">Select a value</span>
</div>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].