lib.xp.examples.schema.createStyles.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
// Create virtual styles.
var result = schemaLib.createStyles({
application: 'myapp',
resource
});
log.info('Created 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);