mirror of
https://github.com/videojs/video.js.git
synced 2025-03-25 22:01:11 +02:00
@gkatsev updated css to have ascii codepoints for fonticons. Expose new scss file. closes #2973
This commit is contained in:
parent
867fec910f
commit
93f2f83723
@ -9,6 +9,7 @@ CHANGELOG
|
||||
* @forbesjo fixed errorDisplay erroring on subsequent openings ([view](https://github.com/videojs/video.js/pull/2966))
|
||||
* @incompl updated build command in CONTRIBUTING.md ([view](https://github.com/videojs/video.js/pull/2967))
|
||||
* @forbesjo updated player to not autoplay if there is no source ([view](https://github.com/videojs/video.js/pull/2971))
|
||||
* @gkatsev updated css to have ascii codepoints for fonticons. Expose new scss file ([view](https://github.com/videojs/video.js/pull/2973))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -151,7 +151,7 @@ module.exports = function(grunt) {
|
||||
watch: {
|
||||
skin: {
|
||||
files: ['src/css/**/*'],
|
||||
tasks: 'sass'
|
||||
tasks: ['sass', 'wrapcodepoints']
|
||||
},
|
||||
jshint: {
|
||||
files: ['src/**/*', 'test/unit/**/*.js', 'Gruntfile.js'],
|
||||
@ -196,7 +196,7 @@ module.exports = function(grunt) {
|
||||
sass: {
|
||||
build: {
|
||||
files: {
|
||||
'build/temp/video-js.css': 'src/css/video-js.scss'
|
||||
'build/temp/video-js.css': 'src/css/vjs.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -455,6 +455,7 @@ module.exports = function(grunt) {
|
||||
'uglify',
|
||||
|
||||
'sass',
|
||||
'wrapcodepoints',
|
||||
'version:css',
|
||||
'cssmin',
|
||||
|
||||
@ -479,6 +480,17 @@ module.exports = function(grunt) {
|
||||
'zip:dist'
|
||||
]);
|
||||
|
||||
// Sass turns unicode codepoints into utf8 characters.
|
||||
// We don't want that so we unwrapped them in the templates/scss.hbs file.
|
||||
// After sass has generated our css file, we need to wrap the codepoints
|
||||
// in quotes for it to work.
|
||||
grunt.registerTask('wrapcodepoints', function() {
|
||||
const sassConfig = grunt.config.get('sass.build.files');
|
||||
const cssPath = Object.keys(sassConfig)[0];
|
||||
const css = grunt.file.read(cssPath);
|
||||
grunt.file.write(cssPath, css.replace(/(\\f\w+);/g, "'$1';"));
|
||||
});
|
||||
|
||||
// Default task - build and test
|
||||
grunt.registerTask('default', ['test']);
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
"object.assign": "^4.0.1",
|
||||
"safe-json-parse": "^4.0.0",
|
||||
"tsml": "1.0.1",
|
||||
"videojs-font": "1.4.0",
|
||||
"videojs-font": "1.5.1",
|
||||
"videojs-ie8": "1.1.1",
|
||||
"videojs-swf": "5.0.1",
|
||||
"videojs-vtt.js": "^0.12.1",
|
||||
|
@ -1 +1,2 @@
|
||||
$icon-font-path: 'font' !default;
|
||||
$icon-codepoints: false !default;
|
||||
|
@ -2,7 +2,11 @@
|
||||
@import "private-variables";
|
||||
@import "utilities";
|
||||
|
||||
@import "../../node_modules/videojs-font/scss/icons";
|
||||
@if $icon-codepoints {
|
||||
@import "../../node_modules/videojs-font/scss/icons-codepoints";
|
||||
} else {
|
||||
@import "../../node_modules/videojs-font/scss/icons";
|
||||
}
|
||||
|
||||
@import "components/layout";
|
||||
@import "components/big-play";
|
||||
|
3
src/css/vjs.scss
Normal file
3
src/css/vjs.scss
Normal file
@ -0,0 +1,3 @@
|
||||
$icon-codepoints: true;
|
||||
|
||||
@import "video-js";
|
Loading…
x
Reference in New Issue
Block a user