Dont set background color if none is provided in options
After comparing the output of this library and what is produced by Microsoft Word, it seems that document background color is not set by default by Word. Removing the default #FFFFFF background color enables the generated documents to be readable in dark mode. This seems to fix dolanmiu/docx#1093
This commit is contained in:
@ -6,14 +6,12 @@ import { DocumentBackground } from "./document-background";
|
||||
|
||||
describe("DocumentBackground", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create a DocumentBackground with no options and set color to auto", () => {
|
||||
it("should create a DocumentBackground with no options", () => {
|
||||
const documentBackground = new DocumentBackground({});
|
||||
const tree = new Formatter().format(documentBackground);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:background": {
|
||||
_attr: {
|
||||
"w:color": "FFFFFF",
|
||||
},
|
||||
_attr: {},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user