Skip to content

Commit

Permalink
Merge branch '2.0/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
firede committed Jun 17, 2015
2 parents 97a0f6e + 12d25e8 commit ea5aa5f
Show file tree
Hide file tree
Showing 148 changed files with 2,749 additions and 806 deletions.
13 changes: 2 additions & 11 deletions .editorconfig
@@ -1,5 +1,4 @@
# 本文件用于在不同的编辑器中统一代码风格
# 请为你的编辑器安装 EditorConfig 插件
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true
Expand All @@ -10,17 +9,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[**.js]
indent_style = space
indent_size = 4

[**.styl]
indent_style = space
[*.{js,styl,html,json}]
indent_size = 4

[**.html]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .fecsignore
@@ -0,0 +1,2 @@
test/**
demo/**
10 changes: 10 additions & 0 deletions .fecsrc
@@ -0,0 +1,10 @@
{
"eslint": {
"env": {
"node": true
},
"rules": {
"no-console": 0
}
}
}
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,4 +1,5 @@
*.log
.idea/
node_modules/
.DS_Store
demo/**/*.css
*.log
1 change: 1 addition & 0 deletions .npmignore
@@ -1,2 +1,3 @@
demo/
test/
demo.js
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,3 +1,4 @@
language: node_js
node_js:
- "0.10"
- "0.12"
24 changes: 24 additions & 0 deletions History.md
@@ -1,4 +1,28 @@

2.0.0 / 2015-06-17
==================

* **Breaking Change** 改进 Function:`bg()`, `ir()` [#18](https://github.com/ecomfe/rider/issues/18)
* **Breaking Change** 改进 Root Mixin:`font-face()` [#16](https://github.com/ecomfe/rider/issues/16) [#24](https://github.com/ecomfe/rider/issues/24)
* **Breaking Change** 改进 Block Mixin:`+breakpoint()`,移除组合能力,迁出 retina 支持 [#19](https://github.com/ecomfe/rider/issues/19)
* **Breaking Change** 移除:retina 支持中的浏览器兼容代码 [#17](https://github.com/ecomfe/rider/issues/17)
* **Breaking Change** 移除 全局变量:`$-image-dppx`,retina 图片机制已更新
* 增加 全局变量:`$-code-font-family` 作为代码段默认字体
* 增加 全局变量:`$-image-dppx-range` 作为 retina 图片的探测范围
* 增加 全局变量:`$-image-dppx-separator` 作为 retina 图片的分隔符
* 增加 全局变量:`$-image-dppx-quality-first` 作为 retina 图片质量优先模式的开关
* 增加 全局变量:`$-unit-precision` 作为单位转换的小数点精度控制
* 增加 Function:`bg2x()`, `bg3x()`, `bg-dppx()` [#23](https://github.com/ecomfe/rider/issues/23)
* 增加 Function:`file-exists()`, `is-url()`, `get-retina-src()` [#15](https://github.com/ecomfe/rider/issues/15)
* 增加 Mixin:`normalize()` 作为布局初始化的补充 [#8](https://github.com/ecomfe/rider/issues/8)
* 增加 Mixin:`circle()` 生成圆形或椭圆
* 增加 Block Mixin:`+retina()` [#20](https://github.com/ecomfe/rider/issues/20)
* 改进 Function:`rem()`, `em()`, `px()` 单位转换定义截取小数点位数 [#4](https://github.com/ecomfe/rider/issues/4)
* 改进 Mixin:`animate()` 升级至 animate.css 3.2.6 版 [#5](https://github.com/ecomfe/rider/issues/5)
* 改进:测试脚本启用 inline diff [#7](https://github.com/ecomfe/rider/issues/7)
* 改进:简化 demo 的支持部分 [#6](https://github.com/ecomfe/rider/issues/6)
* 改进:文档重新经过深入整理 [#21](https://github.com/ecomfe/rider/issues/21)

0.4.4 / 2014-11-06
==================

Expand Down
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Baidu Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 changes: 30 additions & 11 deletions README.md
@@ -1,16 +1,35 @@
rider [![NPM version](https://badge.fury.io/js/rider.png)](https://npmjs.org/package/rider) [![Build Status](https://travis-ci.org/ecomfe/rider.png)](https://travis-ci.org/ecomfe/rider) [![DevDependencies Status](https://david-dm.org/ecomfe/rider/dev-status.png)](https://david-dm.org/ecomfe/rider#info=devDependencies)
rider
===

`rider` 是一个基于 [`stylus`](https://github.com/LearnBoost/stylus)、专注于 **移动 Web** 的 CSS 样式库。
[![NPM version](https://img.shields.io/npm/v/rider.svg?style=flat-square)](https://npmjs.org/package/rider) [![Build Status](https://img.shields.io/travis/ecomfe/rider.svg?style=flat-square)](https://travis-ci.org/ecomfe/rider) [![License](https://img.shields.io/npm/l/rider.svg?style=flat-square)](./LICENSE) [![EFE Mobile Team](https://img.shields.io/badge/EFE-Mobile_Team-blue.svg?style=flat-square)](http://efe.baidu.com)

它提供了样式初始化、顺时针简写、缓动函数、图片、排版、单位转换、形状、动画、响应式工具等功能,可以让你的前端样式开发更轻松、更省心
`rider` 是基于 [Stylus](http://stylus-lang.com) 与后处理器、无侵入风格的 CSS 样式工具库

## 文档
基于 `rider` 开发 **项目****UI 样式库**,能有效提高开发效率,延长代码生命周期。

+ 安装与配置
+ [`edp` 环境使用](https://github.com/ecomfe/edp-provider-rider)
+ [`connect`/`express` 环境使用](./doc/connect.md)
+ [API](./doc/api.md)
+ [代码风格](./doc/code-style.md)
+ [常见问题](./doc/faq.md)
+ [DEMO与单元测试](./doc/demo-and-ut.md)
## 功能

* [特性](./doc/feature.md)
* [样式初始化](./doc/initialize.md)
* [顺时针简写](./doc/clockhand.md)
* [缓动函数](./doc/easing.md)
* [图片](./doc/image.md)
* [排版](./doc/typography.md)
* [形状](./doc/shape.md)
* [动画](./doc/animate.md)
* [单位转换](./doc/unit.md)
* [响应式工具](./doc/breakpoint.md)
* [Retina 支持](./doc/retina.md)
* [辅助函数](./doc/helper.md)

## 使用

* 安装与配置
* [edp 环境](https://github.com/ecomfe/edp-provider-rider)
* [connect/express 环境](./doc/connect.md)
* [代码风格](./doc/code-style.md)
* [常见问题](./doc/faq.md)

## License

MIT © [Baidu Inc.](./LICENSE)
51 changes: 51 additions & 0 deletions demo.js
@@ -0,0 +1,51 @@
/**
* @file rider demo
* @author firede(firede@firede.us)
*/

var path = require('path');
var http = require('http');

var connect = require('connect');
var serveStatic = require('serve-static');

var stylus = require('stylus');
var rider = require('./lib/rider');
var ap = require('autoprefixer-core');

var app = connect();
var port = 8888;

function compile(str, filePath) {
return stylus(str)
.set('filename', filePath)
.define('url', stylus.resolver())
.use(rider())
.on('end', prefixer);
}

function prefixer(_, css) {
return ap(
{
browsers: [
'> 5%',
'iOS >= 6',
'Android >= 2.3',
'ExplorerMobile >= 10'
]
}
).process(css).css;
}

app.use(stylus.middleware({
src: path.join(__dirname, 'demo'),
compile: compile
}));

app.use(
serveStatic(path.join(__dirname, 'demo'))
);

http.createServer(app).listen(port, function () {
console.log('Rider demo started on port %d', port);
});
Empty file added demo/animate.html
Empty file.
5 changes: 5 additions & 0 deletions demo/css/animate.styl
@@ -0,0 +1,5 @@
.test
animate('bounce')

.abc
animate('bounce', 0.5s)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions demo/public/layout.styl → demo/css/layout.styl
Expand Up @@ -2,7 +2,7 @@ initialize()

// Fonts

font-face('rider-icon', 'font/rider-icon', '1')
font-face('rider-icon', '../font/rider-icon')

[class^="icon-"], [class*=" icon-"]
font-family: 'rider-icon'
Expand Down Expand Up @@ -37,7 +37,7 @@ font-face('rider-icon', 'font/rider-icon', '1')
font-size: rem(16)
margin: 0 auto
&.logo
ir: 'img/logo.png'
ir: '../img/logo.png'
size: 75px 44px
.next
.prev
Expand Down
7 changes: 7 additions & 0 deletions demo/public/shape.styl → demo/css/shape.styl
Expand Up @@ -37,3 +37,10 @@
absolute: 15px -10px _ _
triangle: right 10px #939

.circle-test-1
circle: 60px 80px
background: #ccc

.circle-test-2
circle: 2rem
background: #ccc
2 changes: 1 addition & 1 deletion demo/views/easing.ejs → demo/easing.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="easing.css">
<link rel="stylesheet" href="css/easing.css">
<title>easing</title>
</head>
<body>
Expand Down
File renamed without changes
8 changes: 4 additions & 4 deletions demo/views/index.ejs → demo/index.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="css/index.css">
<title>rider</title>
</head>
<body>
Expand All @@ -13,7 +13,7 @@ <h1 class="title logo">rider</h1>
</header>

<div class="item-container">
<a class="title" href="/easing">
<a class="title" href="easing.html">
<i class="icon-tag"></i> easing
</a>
<div class="content">
Expand All @@ -22,7 +22,7 @@ <h1 class="title logo">rider</h1>
</div>

<div class="item-container">
<a class="title" href="/shape">
<a class="title" href="shape.html">
<i class="icon-tag"></i> shape
</a>
<div class="content">
Expand All @@ -31,7 +31,7 @@ <h1 class="title logo">rider</h1>
</div>

<div class="item-container">
<a class="title" href="/initialize">
<a class="title" href="initialize.html">
<i class="icon-tag"></i> initialize
</a>
<div class="content">
Expand Down
2 changes: 1 addition & 1 deletion demo/views/initialize.ejs → demo/initialize.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="initialize.css">
<link rel="stylesheet" href="css/initialize.css">
<title>initialize</title>
</head>
<body>
Expand Down
49 changes: 0 additions & 49 deletions demo/server.js

This file was deleted.

13 changes: 11 additions & 2 deletions demo/views/shape.ejs → demo/shape.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="shape.css">
<link rel="stylesheet" href="css/shape.css">
<title>shape</title>
</head>
<body>
Expand All @@ -17,7 +17,7 @@ <h3 class="subject">size: 50px</h3>
<div class="result">
<div class="size-test-1"></div>
</div>

<h3 class="subject">size: 100px, 50px</h3>
<div class="result">
<div class="size-test-2"></div>
Expand All @@ -38,6 +38,15 @@ <h3 class="subject">triangle: right 10px #939 (with &amp;:after)</h3>
<div class="triangle-test-3"></div>
</div>

<h3 class="subject">circle: 60px 80px</h3>
<div class="result">
<div class="circle-test-1"></div>
</div>

<h3 class="subject">circle: 2rem</h3>
<div class="result">
<div class="circle-test-2"></div>
</div>
</div>
</body>
</html>

0 comments on commit ea5aa5f

Please sign in to comment.