lib.xp.examples.schema.updateStyles.js Maven / Gradle / Ivy
var schemaLib = require('/lib/xp/schema');
var assert = require('/lib/xp/testing');
/* global log*/
let resource = '' +
'' +
'' +
'' +
'Override ${width} ' +
' ' +
'' +
'Cinema ' +
'21:9 ' +
'pixelate(10) ' +
' ' +
' ';
// BEGIN
// Update virtual styles.
var result = schemaLib.updateStyles({
application: 'myapp',
resource
});
log.info('Updated styles: ' + result.application);
// END
assert.assertJsonEquals({
application: 'myapp',
cssPath: 'assets/styles.css',
modifiedTime: '2021-09-25T10:00:00Z',
resource: '' +
'' +
'' +
'' +
'Override ${width} ' +
' ' +
'Cinema ' +
'21:9 pixelate(10) ' +
' ' +
' ',
elements: [
{
element: 'style',
displayName: 'Warning',
name: 'warning'
},
{
element: 'image',
displayName: 'Override ${width}',
name: 'editor-width-auto'
},
{
element: 'image',
displayName: 'Cinema',
name: 'editor-style-cinema'
}
]
}, result);