extjs-gpl
Version:
GPL licensed version of Sencha Ext JS
21 lines (18 loc) • 803 B
JavaScript
Ext.require('Ext.theme.Material');
if (Ext.platformTags.android && Ext.platformTags.chrome && Ext.manifest.material && Ext.manifest.material.toolbar) {
var color = Ext.manifest.material.toolbar.color,
toolbarIsDynamic = Ext.manifest.material.toolbar.dynamic,
head = document.head, meta;
if (toolbarIsDynamic && Ext.supports.CSSVariables) {
color = getComputedStyle(document.body).getPropertyValue('--primary-color-md');
color = color.replace(/ /g, '').replace(/^#(?:\\3)?/, '#');
}
if (color) {
meta = document.createElement('meta');
meta.setAttribute('name', 'theme-color');
meta.setAttribute('content', color);
head.appendChild(meta);
}
}
Ext.namespace('Ext.theme.is').Material = true;
Ext.theme.name = 'Material';