class prefix to isolate from higher class weight

See issue #4
pull/47/head
Ruben Almeida 8 years ago committed by GitHub
parent fe20c9f770
commit 49eaa134da

@ -69,7 +69,8 @@
mode: 'rgb-b', mode: 'rgb-b',
fps: 60, // 1000 / 60 = ~16.7ms fps: 60, // 1000 / 60 = ~16.7ms
delayOffset: 8, delayOffset: 8,
CSSPrefix: 'cp-', CSSPrefixIsolate: '', //prevent classes with higher weight
CSSPrefix: 'cp-', //for internal classes
allMixDetails: true, allMixDetails: true,
alphaBG: 'w', alphaBG: 'w',
imagePath: '' imagePath: ''
@ -302,6 +303,7 @@
function buildView(THIS) { function buildView(THIS) {
var app = document.createElement('div'), var app = document.createElement('div'),
prefix = _options.CSSPrefix, prefix = _options.CSSPrefix,
prefixIsolate = _options.CSSPrefixIsolate ? _options.CSSPrefixIsolate+' ':'',
urlData = 'data:image/png;base64,', urlData = 'data:image/png;base64,',
addStyleSheet = function(cssText, id) { addStyleSheet = function(cssText, id) {
var style = document.createElement('style'); var style = document.createElement('style');
@ -321,6 +323,7 @@
processCSS = function(doesBAS64){ processCSS = function(doesBAS64){
// CSS - system // CSS - system
_data._cssFunc = _data._cssFunc. _data._cssFunc = _data._cssFunc.
replace(/‰/g, prefixIsolate).
replace(/§/g, prefix). replace(/§/g, prefix).
replace('_patches.png', doesBAS64 ? urlData + _data._patchesPng : _options.imagePath + '_patches.png'). replace('_patches.png', doesBAS64 ? urlData + _data._patchesPng : _options.imagePath + '_patches.png').
replace('_vertical.png', doesBAS64 ? urlData + _data._verticalPng : _options.imagePath + '_vertical.png'). replace('_vertical.png', doesBAS64 ? urlData + _data._verticalPng : _options.imagePath + '_vertical.png').
@ -330,6 +333,7 @@
// CSS - main // CSS - main
if (!_options.customCSS) { if (!_options.customCSS) {
_data._cssMain = _data._cssMain. _data._cssMain = _data._cssMain.
replace(/‰/g, prefixIsolate).
replace(/§/g, prefix). replace(/§/g, prefix).
replace('_bgs.png', doesBAS64 ? urlData + _data._bgsPng : _options.imagePath + '_bgs.png'). replace('_bgs.png', doesBAS64 ? urlData + _data._bgsPng : _options.imagePath + '_bgs.png').
replace('_icons.png', doesBAS64 ? urlData + _data._iconsPng : _options.imagePath + '_icons.png'). replace('_icons.png', doesBAS64 ? urlData + _data._iconsPng : _options.imagePath + '_icons.png').

Loading…
Cancel
Save