Skip to content

Commit

Permalink
fix: add missing pre and code block Material styles (#6823)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Nov 21, 2023
1 parent bda4537 commit 8732fac
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../../../theme/material/vaadin-rich-text-editor.js';
import { colorDark } from '@vaadin/vaadin-material-styles/color.js';

describe('rich-text-editor', () => {
let div, element;
Expand Down Expand Up @@ -66,4 +67,21 @@ describe('rich-text-editor', () => {
]`;
await visualDiff(div, 'max-height');
});

it('dark theme', async () => {
document.documentElement.setAttribute('theme', 'dark');

fixtureSync(`<style>${colorDark.toString().replace(':host', 'html')}</style>`);

element.value = `[
{"insert":"<body>"},
{"attributes":{"code-block":true},"insert":"\\n"},
{"insert":" <vaadin-rich-text-editor></vaadin-rich-text-editor>"},
{"attributes":{"code-block":true},"insert":"\\n"},
{"insert":"</body>"},
{"attributes":{"code-block":true},"insert":"\\n"},
{"insert":"\\n"}
]`;
await visualDiff(div, 'dark-theme');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ const richTextEditor = css`
strong {
font-weight: 600;
}
code,
pre {
background-color: var(--material-secondary-background-color);
}
`;

registerStyles('vaadin-rich-text-editor', [typography, richTextEditor], {
Expand Down

0 comments on commit 8732fac

Please sign in to comment.