Skip to content

Commit 6ad484a

Browse files
author
clrux
committed
Merge pull request #312 from edx/clrux/updating-modernizr-edx-icons
Updating Modernizr; adding FontAwesome to icon init
2 parents d42a12d + e1ad81c commit 6ad484a

File tree

8 files changed

+37
-503
lines changed

8 files changed

+37
-503
lines changed

gulp/tasks/build-development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'clean',
1010
'fonts',
1111
'images',
12+
'modernizr',
1213
['scripts', 'pldoc_scripts', 'demo_scripts'],
1314
['styles', 'pldoc_styles', 'demo_styles'],
1415
'webpack',

gulp/tasks/modernizr.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var gulp = require('gulp'),
2+
browserSync = require('browser-sync'),
3+
config = require('../config'),
4+
uglify = require('gulp-uglify'),
5+
modernizr = require('gulp-modernizr');
6+
7+
gulp.task('modernizr', ['scripts-lint'], function() {
8+
gulp.src('*.js')
9+
.pipe(modernizr('modernizr-custom.js'))
10+
.pipe(gulp.dest(config.scripts.src));
11+
});

modernizr-config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"minify": false,
3+
"options": [
4+
"setClasses"
5+
],
6+
"feature-detects": [
7+
"test/css/fontface",
8+
"test/css/generatedcontent"
9+
]
10+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"gulp-filter": "*",
4242
"gulp-imagemin": "*",
4343
"gulp-minify-css": "*",
44+
"gulp-modernizr": "*",
4445
"gulp-notify": "*",
4546
"gulp-rename": "*",
4647
"gulp-sass": "*",
@@ -52,6 +53,7 @@
5253
"lodash": "*",
5354
"merge-stream": "*",
5455
"minimist": "*",
56+
"modernizr": "*",
5557
"require-dir": "*",
5658
"run-sequence": "*",
5759
"text-loader": "*",

pattern-library/js/edx-icons.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
define(['afontgarde'],
2-
function() {
3-
'use strict';
1+
define(['afontgarde'], function() {
2+
'use strict';
43

5-
window.AFontGarde('edx-icons', {
6-
// Check a few random icons to see if our font loads
7-
glyphs: '\uE621\uE622\uE623'
8-
});
4+
// Old icon fonts, currently used in the platform.
5+
window.AFontGarde('FontAwesome', {
6+
glyphs: ''
97
});
8+
9+
// New icon fonts for UXPL to eventually replace FontAwesome.
10+
window.AFontGarde('edx-icons', {
11+
glyphs: '\uE621\uE622\uE623'
12+
});
13+
});

0 commit comments

Comments
 (0)