feat: refs #6367 mixStyles
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
c91b745f0e
commit
d99e002cc7
|
@ -74,11 +74,10 @@ class Component {
|
|||
}
|
||||
|
||||
get stylesheet() {
|
||||
let mergedStyles = '';
|
||||
const stylePath = path.resolve(__dirname, `${this.path}/assets/css`);
|
||||
|
||||
if (!fs.existsSync(stylePath))
|
||||
return mergedStyles;
|
||||
return '';
|
||||
|
||||
return require(`${stylePath}/import`);
|
||||
}
|
||||
|
@ -101,6 +100,7 @@ class Component {
|
|||
const component = require(`${this.path}/${this.name}`);
|
||||
component.i18n = this.locale;
|
||||
component.attachments = this.attachments;
|
||||
console.log('this.stylesheet: ', this.stylesheet);
|
||||
component.template = juice.inlineContent(this.template, this.stylesheet, {
|
||||
inlinePseudoElements: true
|
||||
});
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
class Stylesheet {
|
||||
constructor(files) {
|
||||
|
@ -8,9 +7,8 @@ class Stylesheet {
|
|||
}
|
||||
|
||||
mergeStyles() {
|
||||
for (const file of this.files) {
|
||||
for (const file of this.files)
|
||||
this.css.push(fs.readFileSync(file));
|
||||
}
|
||||
|
||||
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/misc.css`,
|
||||
`${vnPrintPath}/common/css/layout.css`,
|
||||
`${vnPrintPath}/common/css/email.css`])
|
||||
`${vnPrintPath}/common/css/email.css`,
|
||||
`${__dirname}/style.css`])
|
||||
.mergeStyles();
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.claseTest{
|
||||
color: red;
|
||||
}
|
Loading…
Reference in New Issue