npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

melon

v0.6.0-alpha.3

Published

ui components for react

Downloads

39

Readme

melon

Coverage Status Version Build Status

SauceLabs Status

A Set of React Components that Implement Google's Material Design

Install

npm

melon

bower

bower install melon

Melon Family

Components

Demos

http://react-melon.github.io/melon

Compatible for ie8

You need use es5-shimes5-sham on ie8

see es5-shim es5-sham es5-shim

如何在 webpack 中使用 melon

  1. 安装依赖

    
    # melon
    npm i melon --save
    
    # 编译 melon 样式的依赖
    npm i stylus-loader file-loader stylus nib css-loader style-loader --save-dev
    
  2. 配置 webpack:

    webpack 中添加以下配置

    
    module.exports = {
        loaders: [
            // 处理 stylus
            {
                test: /\.styl$/,
                loader: 'style!css!stylus?paths=node_modules&resolve url'
            },
            // 处理 iconfont
            {
                test: /\.(svg|eot|ttf|woff)(\?.*)?$/,
                loader: 'file'
            }
        ],
        // stylus loader 中引入 nib 库支持
        stylus: {
            use: [require('nib')()]
        }
    };
    

    其中,stylus 的参数中的 paths=node_modules指定 stylus 文件的寻找范围,resolve url用于将 melon 中相对路径资源转换为绝对路径资源。

  3. 使用一个 stylus 文件来引入业务所需要的 melon 样式文件。

    将 melon 组件的样式组织在一个入口样式文件中,比如 ${YOUR_PROJECT}/src/melon.styl

    
    // 主题必须引入
    @require 'melon/css/theme/default/index.styl';
    
    // 其他组件按需引入
    @require 'melon/css/Button.styl';
    

    其中主题样式文件是必选的,然后需要用到什么组件,就引入相应的组件样式。

  4. 在合适的 js 中引入需要的 melon 组件:

    
    // 加载样式
    import './melon.styl';
    
    // 加载组件
    import Button from 'melon/Button';
    
    export default function App(props) {
    
        return (
            <Button>melon button</Button>
        );
    
    }
    

经过以上步骤就完成了 melon 的引入了。另外,还可以参考这个 demo repo