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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mip-mag-design

v2.0.2

Published

mag design components

Readme

Mag design in MIP

Build Status npm

本项目是 Mag Design 设计规范的组件库,本文档主要介绍组件的使用方法和组件的开发指南。

依赖与安装

确保安装了Node.js(版本>=4)。

使用方式

使用 CDN

说明 | 链接 | 备注 --- | --- | --- 大版本号 | https://c.mipcdn.com/static/mag-design/v大版本号/mag-design.min.css ,如:https://c.mipcdn.com/static/mag-design/v2/mag-design.min.css | 浏览器过期时间为10分钟 小版本号 | https://c.mipcdn.com/static/mag-design/小版本号/mag-design.min.css ,如:https://c.mipcdn.com/static/mag-design/2.0.0/mag-design.min.css | 浏览器过期时间为10年

npm 安装

npm install mip-mag-design --save

并在代码中使用合适的方式引用:

webpack

require('mip-mag-design');

html

<link rel="stylesheet" type="text/css" src="/node_modules/mip-mag-design/dist/mag-design.min.css">

css

@import "/node_modules/mip-mag-design/dist/mag-design.min.css"

stylus

@require "/node_modules/mip-mag-design/src/base/main"

从源码编译

# 克隆仓库
git clone https://github.com/mipengine/mip-mag-design.git
# 进入仓库目录
cd mag-design/
# 安装依赖
npm i
# 构建
npm run build

获取 dist/mag-design.min.css 包进行部署。

组件使用

参考 example/index.html

开发指南

环境准备

确保安装了Node.js(>=4),然后克隆仓库并安装依赖。

# 克隆仓库
git clone https://github.com/mipengine/mip-mag-design.git
# 进入仓库目录
cd mag-design/
# 安装依赖
npm i

创建组件

工具自动生成stylindex.htmlREADEME.md文件

npm run creat xxx

样式开发

  • 样式开发遵从stylus语法,语法学习请移步:stylus语法
  • 组件样式须在src/base/main.styl中引入:
@require 'reset'
@require '../button/button'
@require '../link/link'

demo开发

书写html即可,引入mag-design.min.css路径为:

  • 组件demo引入方式:
<link rel="stylesheet" type="text/css" href="../mag-design.min.css">
  • example下demo引入方式:
<link rel="stylesheet" type="text/css" href="../dist/mag-design.min.css">

编译打包

src下的所有styl文件编译、压缩、打包到dist目录;将srcexample下的html文件拷贝到dist下。

npm run build

预览

使用本地server预览组件。 首先需要在对应组件下编写demo文件index.html

  • 组件的demo路径:src/xxx/index.html
  • 页面级别(所有组件)的demo路径:src/example/index.html
# 预览单个组件demo
npm run preview button

# 预览页面级别(所有组件)demo
npm run preview

提交

# add需要提交的文件
git add xxx

# 提交一个commit
git commit -m 'xxxx'

# 打包一个版本,通常打包小版本patch
npm version [patch | minor | major]

# 提交源代码到仓库
git push

# 发布npm包
npm publish

提交信息规范

git commit 信息和 pull request 标题必须遵循 MIP 项目的 提交信息规范 ,否则不予合入。

License

Copyright (c) 2017-present, Baidu Inc.