Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
148 changed files
with
2,749 additions
and
806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test/** | ||
demo/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"eslint": { | ||
"env": { | ||
"node": true | ||
}, | ||
"rules": { | ||
"no-console": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.log | ||
.idea/ | ||
node_modules/ | ||
.DS_Store | ||
demo/**/*.css | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
demo/ | ||
test/ | ||
demo.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "0.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.