Code Monkey home page Code Monkey logo

polythene's Introduction

Polythene

Join the chat at https://gitter.im/ArthurClemens/Polythene CDNJS

Modular implementation of Material Design for Mithril.

Release 0.2.0

This release contains a major refactoring of all components, including:

  • CSS now uses BEM notation
  • Polythene-theme is now integrated
  • More options to customize theming
  • Simplified opening/closing of dialogs
  • Rewrite of Slider with more customization options

Added components:

  • Checkbox
  • Radio button
  • Search
  • Spinner
  • Switch
  • Text field

Background

Setup

Polythene uses Node tools to build. It runs in the browser.

Source files are written in es6 and transpiled to es5. The building blocks are async es6 modules and loaded when needed, but using SystemJS / jspm / Browserify it is also possible to create bundles where all required modules are combined.

Polythene works both in es6 and es5 applications.

Basic example

A simple es6 module that shows a button:

import m from 'mithril';
import button from 'polythene/button/button';
import 'polythene/theme/theme';

const app = {
    view: () => {
        return m('div', [
            m.component(button, {
                label: 'Button',
                raised: true
            })
        ]);
    }
};

m.mount(document.body, app);

Standalone version

A standalone script is included for use on JSBin / JSFiddle. Include this script:

https://rawgit.com/ArthurClemens/Polythene/master/polythene-standalone.js

Installation

You will need:

  • Polythene - the core components (this repository; see instructions below)
  • Polythene examples - (optional) to see implementations of components

Using npm with SystemJS or Browserify

npm install polythene

Using jspm

jspm install github:ArthurClemens/Polythene

Using Polythene with es5

When using Browserify, use require to get components:

var m = require('mithril');
require('polythene/theme/theme');
var btn = require('polythene/button/button');

Developing

The included transpile script calls Babel with params --presets es2015 and --plugins babel-plugin-add-module-exports.

Transpile everything once:

  • npm run transpile

Watch changes while developing:

  • npm run watch

Browser support

The default theme uses flexbox, so this works in IE10 and other browsers. For IE9 you will need to adapt the theme.

Project progress

Done

  • Button
  • Card
  • Checkbox
  • Dialog
  • Divider (part of List)
  • Floating Action Button
  • Header panel
  • Icon
  • Icon button (toggle button)
  • List
  • List tile
  • Menu, Simple menu
  • Notification and Snackbar
  • Radio button
  • Ripple
  • Search
  • Shadow
  • Slider
  • Spinner
  • Subheader (part of List)
  • SVG
  • Switch
  • Tabs
  • Text field
  • Theming
  • Toolbar
  • Validation

To do

  1. Collapse
  2. Dropdown button
  3. Progress bar
  4. Bottom sheet
  5. Grid list
  6. Data table
  7. Stepper
  8. Tooltip
  9. Side menu
  10. Picker
  11. Chip
  12. Reorder list

License

MIT

polythene's People

Contributors

arthurclemens avatar gitter-badger avatar mneumann avatar nolsherry avatar phearzero avatar richardivan avatar

Watchers

 avatar  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.