Skip to content

Commit d13b7f8

Browse files
[init] DevUI font icons
0 parents  commit d13b7f8

File tree

166 files changed

+4258
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+4258
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.log
2+
.*.swp
3+
.idea/
4+
.tmp/
5+
package-lock.json
6+
dist/
7+
node_modules/
8+
public/
9+
aot/
10+
11+
.DS_Store
12+
*/.DS_Store
13+
*/*/DS_Store
14+
*/*/*.db
15+
.vscode/*

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2019 DevCloudFE.
4+
Copyright (c) 2019 Huawei Technologies Co., Ltd.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
## 如何使用
3+
4+
### 1. 安装
5+
6+
```bash
7+
# install
8+
npm i @devui-design/icons
9+
```
10+
11+
### 2. 引入样式
12+
`styles.scss|styles.css` 文件中引入devui icons样式:
13+
```
14+
@import '~@devui-design/icons/icomoon/devui-icon.css';
15+
```
16+
### 3. 使用参考
17+
[DevUI](http://devui.design)

gulpfile.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
var gulp = require('gulp');
2+
var fs = exports.fs = require('fs');
3+
4+
var iconfont = require('gulp-iconfont');
5+
var iconfontCss = require('gulp-iconfont-css');
6+
var template = require('gulp-template');
7+
8+
var runSequence = require('run-sequence');
9+
var cssUrls = require('gulp-css-urls');
10+
11+
var fontName = 'devui-icomoon';
12+
var devUIFontDir = './icomoon/';
13+
var runTimestamp = Math.round(Date.now() / 1000);
14+
15+
gulp.task('iconfont', function () {
16+
gulp.src(devUIFontDir + 'svg/**/*.svg')
17+
.pipe(iconfontCss({
18+
fontName: fontName,
19+
path: './templates/_icon.less',
20+
targetPath: '../devui-icon.css',
21+
cssClass: 'icon',
22+
fontPath: 'fonts/',
23+
centerHorizontally: true,
24+
cacheBuster: runTimestamp,
25+
}))
26+
.pipe(iconfont({
27+
fontName: fontName,
28+
formats: [ 'svg','ttf', 'eot', 'woff'],
29+
normalize: true,
30+
fontHeight:1001,
31+
cacheBuster: runTimestamp,
32+
})).on('glyphs', function(glyphs, options) {
33+
console.log(glyphs, options);
34+
})
35+
.pipe(gulp.dest( './icomoon/fonts'));
36+
});
37+
38+
function getIcons( dir) {
39+
let opIcons = [];
40+
if(fs.existsSync("./" + dir)) {
41+
opIconsTmp = fs.readdirSync("./" + dir);
42+
opIconsTmp.map(function (icon) {
43+
if(icon.endsWith(".svg") ) {
44+
opIcons.push(icon.replace(/\.\w+$/, ''));
45+
}
46+
});
47+
}
48+
console.log(opIcons);
49+
return opIcons;
50+
}
51+
52+
gulp.task('demo', function () {
53+
let dirname = './';
54+
55+
gulp.src(`${dirname}/templates/index.html`)
56+
.pipe(template({
57+
opIcons: getIcons("icomoon/svg/op"),
58+
statusIcons: getIcons("icomoon/svg/status"),
59+
cssName: 'devui-icon',
60+
}))
61+
.pipe(gulp.dest("."));
62+
});
63+

gulptasks/global.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var fs = exports.fs = require('fs');
2+
var path = exports.path = require('path');
3+
exports.merge = require('merge-stream');
4+
exports.rename = require('gulp-rename');
5+
exports.gulpif = require('gulp-if');
6+
var argv = exports.argv = require('yargs').argv;
7+
exports.isDev = !!argv.dev;
8+
exports.dir = argv.dir || '';
9+
exports.header = require('gulp-header');
10+
11+
exports.msg = {
12+
ok: "\n _______ ___ _ \n | || | | | \n | _ || |_| | \n | | | || _| \n | |_| || |_ \n | || _ | \n |_______||___| |_| \n",
13+
error: "\n ______ _____ _____ ____ _____ \n | ____| __ \\| __ \\ / __ \\| __ \\ \n | |__ | |__) | |__) | | | | |__) | \n | __| | _ /| _ /| | | | _ / \n | |____| | \\ \\| | \\ \\| |__| | | \\ \\ \n |______|_| \\_\\_| \\_\\\\____/|_| \\_\\ \n",
14+
robot: "\n _____ ____ ____ ____ _______ \n | __ \\ / __ \\| _ \\ / __ \\__ __|\n | |__) | | | | |_) | | | | | | \n | _ /| | | | _ <| | | | | | \n | | \\ \\| |__| | |_) | |__| | | | \n |_| \\_\\\\____/|____/ \\____/ |_| \n \n ",
15+
sorrow: "(works;) !!!",
16+
}
17+
18+
exports.getFolders = function (dir) {
19+
return fs.readdirSync(dir)
20+
.filter(function(file) {
21+
if (file.indexOf('_') === 0 || file.indexOf('.') === 0 ) {
22+
return false;
23+
} else {
24+
return fs.statSync(path.join(dir, file)).isDirectory();
25+
}
26+
});
27+
};

0 commit comments

Comments
 (0)