Use d2h-light-color-scheme for light
This commit is contained in:
parent
987d8cb65c
commit
7410d25ee4
7 changed files with 26 additions and 25 deletions
|
|
@ -205,7 +205,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty line by line html from diff', () => {
|
it('should generate pretty line by line html from diff', () => {
|
||||||
const result = html(diffExample1, { drawFileList: false });
|
const result = html(diffExample1, { drawFileList: false });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -262,7 +262,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty line by line html from json', () => {
|
it('should generate pretty line by line html from json', () => {
|
||||||
const result = html(jsonExample1, { drawFileList: false });
|
const result = html(jsonExample1, { drawFileList: false });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -319,7 +319,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty diff with files summary', () => {
|
it('should generate pretty diff with files summary', () => {
|
||||||
const result = html(diffExample1, { drawFileList: true });
|
const result = html(diffExample1, { drawFileList: true });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-file-list-wrapper">
|
"<div class="d2h-file-list-wrapper d2h-light-color-scheme">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed (1)</span>
|
<span class="d2h-file-list-title">Files changed (1)</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
@ -339,7 +339,7 @@ describe('Diff2Html', () => {
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><div class="d2h-wrapper">
|
</div><div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -396,7 +396,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty side by side html from diff', () => {
|
it('should generate pretty side by side html from diff', () => {
|
||||||
const result = html(diffExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: false });
|
const result = html(diffExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: false });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -467,7 +467,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty side by side html from json', () => {
|
it('should generate pretty side by side html from json', () => {
|
||||||
const result = html(jsonExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: false });
|
const result = html(jsonExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: false });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -538,7 +538,7 @@ describe('Diff2Html', () => {
|
||||||
it('should generate pretty side by side html from diff 2', () => {
|
it('should generate pretty side by side html from diff 2', () => {
|
||||||
const result = html(diffExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: true });
|
const result = html(diffExample1, { outputFormat: OutputFormatType.SIDE_BY_SIDE, drawFileList: true });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-file-list-wrapper">
|
"<div class="d2h-file-list-wrapper d2h-light-color-scheme">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed (1)</span>
|
<span class="d2h-file-list-title">Files changed (1)</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
@ -558,7 +558,7 @@ describe('Diff2Html', () => {
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><div class="d2h-wrapper">
|
</div><div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -652,7 +652,7 @@ describe('Diff2Html', () => {
|
||||||
' \n';
|
' \n';
|
||||||
const result = html(diffExample2, { drawFileList: false });
|
const result = html(diffExample2, { drawFileList: false });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-211439" class="d2h-file-wrapper" data-lang="md">
|
<div id="d2h-211439" class="d2h-file-wrapper" data-lang="md">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -878,7 +878,7 @@ describe('Diff2Html', () => {
|
||||||
|
|
||||||
const result = html(diff);
|
const result = html(diff);
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-file-list-wrapper">
|
"<div class="d2h-file-list-wrapper d2h-light-color-scheme">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed (1)</span>
|
<span class="d2h-file-list-title">Files changed (1)</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
@ -898,7 +898,7 @@ describe('Diff2Html', () => {
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><div class="d2h-wrapper">
|
</div><div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-597266" class="d2h-file-wrapper" data-lang="html">
|
<div id="d2h-597266" class="d2h-file-wrapper" data-lang="html">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -980,7 +980,7 @@ describe('Diff2Html', () => {
|
||||||
const result = html(diff);
|
const result = html(diff);
|
||||||
/* eslint-disable no-irregular-whitespace */
|
/* eslint-disable no-irregular-whitespace */
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-file-list-wrapper">
|
"<div class="d2h-file-list-wrapper d2h-light-color-scheme">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed (1)</span>
|
<span class="d2h-file-list-title">Files changed (1)</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
@ -1000,7 +1000,7 @@ describe('Diff2Html', () => {
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><div class="d2h-wrapper">
|
</div><div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-719103" class="d2h-file-wrapper" data-lang="js">
|
<div id="d2h-719103" class="d2h-file-wrapper" data-lang="js">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ describe('FileListRenderer', () => {
|
||||||
];
|
];
|
||||||
const fileHtml = fileListRenderer.render(files);
|
const fileHtml = fileListRenderer.render(files);
|
||||||
expect(fileHtml).toMatchInlineSnapshot(`
|
expect(fileHtml).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-file-list-wrapper">
|
"<div class="d2h-file-list-wrapper d2h-light-color-scheme">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed (4)</span>
|
<span class="d2h-file-list-title">Files changed (4)</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ describe('LineByLineRenderer', () => {
|
||||||
});
|
});
|
||||||
const html = lineByLineRenderer.render(exampleJson);
|
const html = lineByLineRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="txt">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="txt">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -523,7 +523,7 @@ describe('LineByLineRenderer', () => {
|
||||||
});
|
});
|
||||||
const html = lineByLineRenderer.render(exampleJson);
|
const html = lineByLineRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -583,7 +583,7 @@ describe('LineByLineRenderer', () => {
|
||||||
const lineByLineRenderer = new LineByLineRenderer(hoganUtils);
|
const lineByLineRenderer = new LineByLineRenderer(hoganUtils);
|
||||||
const html = lineByLineRenderer.render(exampleJson);
|
const html = lineByLineRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ describe('SideBySideRenderer', () => {
|
||||||
const sideBySideRenderer = new SideBySideRenderer(hoganUtils, { matching: LineMatchingType.LINES });
|
const sideBySideRenderer = new SideBySideRenderer(hoganUtils, { matching: LineMatchingType.LINES });
|
||||||
const html = sideBySideRenderer.render(exampleJson);
|
const html = sideBySideRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="txt">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="txt">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -363,7 +363,7 @@ describe('SideBySideRenderer', () => {
|
||||||
const sideBySideRenderer = new SideBySideRenderer(hoganUtils, {});
|
const sideBySideRenderer = new SideBySideRenderer(hoganUtils, {});
|
||||||
const html = sideBySideRenderer.render(exampleJson);
|
const html = sideBySideRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
@ -434,7 +434,7 @@ describe('SideBySideRenderer', () => {
|
||||||
const sideBySideRenderer = new SideBySideRenderer(hoganUtils);
|
const sideBySideRenderer = new SideBySideRenderer(hoganUtils);
|
||||||
const html = sideBySideRenderer.render(exampleJson);
|
const html = sideBySideRenderer.render(exampleJson);
|
||||||
expect(html).toMatchInlineSnapshot(`
|
expect(html).toMatchInlineSnapshot(`
|
||||||
"<div class="d2h-wrapper">
|
"<div class="d2h-wrapper d2h-light-color-scheme">
|
||||||
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
<div id="d2h-675094" class="d2h-file-wrapper" data-lang="js">
|
||||||
<div class="d2h-file-header">
|
<div class="d2h-file-header">
|
||||||
<span class="d2h-file-name-wrapper">
|
<span class="d2h-file-name-wrapper">
|
||||||
|
|
|
||||||
|
|
@ -89,11 +89,12 @@ export function toCSSClass(lineType: LineType): CSSLineClass {
|
||||||
export function colorSchemeToCss(colorScheme: ColorSchemeType): string {
|
export function colorSchemeToCss(colorScheme: ColorSchemeType): string {
|
||||||
switch (colorScheme) {
|
switch (colorScheme) {
|
||||||
case ColorSchemeType.DARK:
|
case ColorSchemeType.DARK:
|
||||||
return ' d2h-dark-color-scheme';
|
return 'd2h-dark-color-scheme';
|
||||||
case ColorSchemeType.AUTO:
|
case ColorSchemeType.AUTO:
|
||||||
return ' d2h-auto-color-scheme';
|
return 'd2h-auto-color-scheme';
|
||||||
|
case ColorSchemeType.LIGHT:
|
||||||
default:
|
default:
|
||||||
return '';
|
return 'd2h-light-color-scheme';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="d2h-file-list-wrapper{{colorScheme}}">
|
<div class="d2h-file-list-wrapper {{colorScheme}}">
|
||||||
<div class="d2h-file-list-header">
|
<div class="d2h-file-list-header">
|
||||||
<span class="d2h-file-list-title">Files changed ({{filesNumber}})</span>
|
<span class="d2h-file-list-title">Files changed ({{filesNumber}})</span>
|
||||||
<a class="d2h-file-switch d2h-hide">hide</a>
|
<a class="d2h-file-switch d2h-hide">hide</a>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<div class="d2h-wrapper{{colorScheme}}">
|
<div class="d2h-wrapper {{colorScheme}}">
|
||||||
{{{content}}}
|
{{{content}}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue