Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/overlay/src/styles/vaadin-overlay-base-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ export const overlayStyles = css`
overscroll-behavior: contain;
pointer-events: auto;
-webkit-tap-highlight-color: initial;

/* CSS reset for font styles */
color: initial;
font: initial;
letter-spacing: initial;
text-align: initial;
text-decoration: initial;
text-indent: initial;
text-transform: initial;
white-space: initial;
word-spacing: initial;
}

[part='backdrop'] {
Expand Down
24 changes: 24 additions & 0 deletions packages/overlay/test/visual/base/overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,28 @@ describe('overlay', () => {
element.opened = true;
await visualDiff(div, 'with-backdrop');
});

it('text-style-reset', async () => {
Object.assign(div.style, {
color: 'red',
fontFamily: "'Comic Sans MS', cursive",
fontSize: '20px',
fontStyle: 'italic',
fontWeight: 'bold',
fontVariant: 'small-caps',
lineHeight: '2',
letterSpacing: '2px',
textAlign: 'center',
textDecoration: 'underline',
textTransform: 'uppercase',
textIndent: '20px',
whiteSpace: 'nowrap',
wordSpacing: '20px',
});
// Make overlay smaller to force text wrapping, also tests text-align on wrapped text
element.$.overlay.style.width = '150px';
element.opened = true;

await visualDiff(div, 'text-style-reset');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions packages/overlay/test/visual/lumo/overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,28 @@ describe('overlay', () => {
element.opened = true;
await visualDiff(div, 'with-backdrop');
});

it('text-style-reset', async () => {
Object.assign(div.style, {
color: 'red',
fontFamily: "'Comic Sans MS', cursive",
fontSize: '20px',
fontStyle: 'italic',
fontWeight: 'bold',
fontVariant: 'small-caps',
lineHeight: '2',
letterSpacing: '2px',
textAlign: 'center',
textDecoration: 'underline',
textIndent: '20px',
textTransform: 'uppercase',
whiteSpace: 'nowrap',
wordSpacing: '20px',
});
// Make overlay smaller to force text wrapping, also tests text-align on wrapped text
element.$.overlay.style.width = '150px';
element.opened = true;

await visualDiff(div, 'text-style-reset');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions packages/vaadin-lumo-styles/src/mixins/overlay.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,22 @@
box-shadow:
0 0 0 1px var(--lumo-shade-5pct),
var(--lumo-box-shadow-m);

/* CSS reset for font styles */
color: var(--lumo-body-text-color);
font-family: var(--lumo-font-family);
font-size: var(--lumo-font-size-m);
font-style: normal;
font-weight: 400;
font-variant: normal;
line-height: var(--lumo-line-height-m);
letter-spacing: 0;
text-align: initial;
text-decoration: none;
text-indent: initial;
text-transform: none;
white-space: initial;
word-spacing: initial;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down