WIP: 6367-blankNotification #1903
|
@ -74,11 +74,10 @@ class Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get stylesheet() {
|
get stylesheet() {
|
||||||
let mergedStyles = '';
|
|
||||||
const stylePath = path.resolve(__dirname, `${this.path}/assets/css`);
|
const stylePath = path.resolve(__dirname, `${this.path}/assets/css`);
|
||||||
|
|
||||||
if (!fs.existsSync(stylePath))
|
if (!fs.existsSync(stylePath))
|
||||||
return mergedStyles;
|
return '';
|
||||||
|
|
||||||
return require(`${stylePath}/import`);
|
return require(`${stylePath}/import`);
|
||||||
}
|
}
|
||||||
|
@ -101,6 +100,7 @@ class Component {
|
||||||
const component = require(`${this.path}/${this.name}`);
|
const component = require(`${this.path}/${this.name}`);
|
||||||
component.i18n = this.locale;
|
component.i18n = this.locale;
|
||||||
component.attachments = this.attachments;
|
component.attachments = this.attachments;
|
||||||
|
console.log('this.stylesheet: ', this.stylesheet);
|
||||||
component.template = juice.inlineContent(this.template, this.stylesheet, {
|
component.template = juice.inlineContent(this.template, this.stylesheet, {
|
||||||
inlinePseudoElements: true
|
inlinePseudoElements: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
class Stylesheet {
|
class Stylesheet {
|
||||||
constructor(files) {
|
constructor(files) {
|
||||||
|
@ -8,9 +7,8 @@ class Stylesheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeStyles() {
|
mergeStyles() {
|
||||||
for (const file of this.files) {
|
for (const file of this.files)
|
||||||
this.css.push(fs.readFileSync(file));
|
this.css.push(fs.readFileSync(file));
|
||||||
}
|
|
||||||
|
|
||||||
return this.css.join('\n');
|
return this.css.join('\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
const Component = require(`vn-print/core/component`);
|
|
||||||
const emailBody = new Component('email-body');
|
|
||||||
module.exports = {
|
|
||||||
name: 'blank-notification',
|
|
||||||
components: {
|
|
||||||
'email-body': emailBody.build()
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
subject: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,3 +0,0 @@
|
||||||
subject: Asunto
|
|
||||||
title: Titulo
|
|
||||||
text: Texto
|
|
|
@ -7,6 +7,7 @@ module.exports = new Stylesheet([
|
||||||
`${vnPrintPath}/common/css/spacing.css`,
|
`${vnPrintPath}/common/css/spacing.css`,
|
||||||
`${vnPrintPath}/common/css/misc.css`,
|
`${vnPrintPath}/common/css/misc.css`,
|
||||||
`${vnPrintPath}/common/css/layout.css`,
|
`${vnPrintPath}/common/css/layout.css`,
|
||||||
`${vnPrintPath}/common/css/email.css`])
|
`${vnPrintPath}/common/css/email.css`,
|
||||||
|
`${__dirname}/style.css`])
|
||||||
.mergeStyles();
|
.mergeStyles();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.claseTest{
|
||||||
|
color: red;
|
||||||
|
}
|
Loading…
Reference in New Issue