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
15 changes: 6 additions & 9 deletions components/scroll-wrapper/scroll-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ let focusStyleSheet;
function getFocusStyleSheet() {
if (!focusStyleSheet) {
focusStyleSheet = new CSSStyleSheet();
focusStyleSheet.replaceSync(getFocusRingStyles(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bit of history around this. The 0 2px 12px 0 rgba(0, 0, 0, 0.15) is our "floating" shadow. I think it was unintentionally copied forward when the focus styles were moved from the scroller buttons to the scroll-wrapper container. At the time, the shadow was also being used for the focus outline. We don't really want or need this shadow.

'.d2l-scroll-wrapper-focus',
{ extraStyles: css`box-shadow: 0 0 0 2px #ffffff, 0 2px 12px 0 rgba(0, 0, 0, 0.15);` }
));
focusStyleSheet.replaceSync(getFocusRingStyles('.d2l-scroll-wrapper-focus'));
}
return focusStyleSheet;
}
Expand Down Expand Up @@ -97,7 +94,7 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
overflow-y: var(--d2l-scroll-wrapper-overflow-y, visible);
}
:host([h-scrollbar]) .d2l-scroll-wrapper-container {
border-inline: 1px dashed var(--d2l-color-mica);
border-inline: 1px dashed var(--d2l-theme-border-color-standard);
}
:host([h-scrollbar][hide-actions]) .d2l-scroll-wrapper-container {
border-inline: none;
Expand All @@ -124,10 +121,10 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
}

.d2l-scroll-wrapper-button {
background-color: var(--d2l-color-regolith);
border: 1px solid var(--d2l-color-mica);
background-color: var(--d2l-theme-background-color-interactive-faint-default);
border: 1px solid var(--d2l-theme-border-color-standard);
border-radius: 50%;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
box-shadow: var(--d2l-theme-shadow-floating);
cursor: pointer;
display: inline-block;
height: 18px;
Expand All @@ -138,7 +135,7 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
width: 18px;
}
.d2l-scroll-wrapper-button:hover {
background-color: var(--d2l-color-sylvite);
background-color: var(--d2l-theme-background-color-interactive-faint-hover);
}
:host([scrollbar-right]) .d2l-scroll-wrapper-button-right {
display: none;
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 10 additions & 11 deletions components/scroll-wrapper/test/scroll-wrapper.vdiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,19 @@ describe('scroll-wrapper', () => {
});
});

describe('focus', () => {
it('show-actions', async() => {
const elem = await fixture(wrapScrollWrapper(html`<d2l-test-scroll-wrapper width="400" class="vdiff-include"></d2l-test-scroll-wrapper>`));
await focusElem(elem.querySelector('d2l-test-scroll-wrapper'));
[
{ name: 'show-actions', allColorModes: true },
{ name: 'show-actions-focus', allColorModes: true, action: elem => { return focusElem(elem.querySelector('d2l-test-scroll-wrapper')); } },
{ name: 'split-scrollers', splitScrollers: true },
{ name: 'split-scrollers-focus', splitScrollers: true, action: elem => { return focusElem(elem.querySelector('d2l-test-scroll-wrapper')); } },
].forEach(({ action, allColorModes, name, splitScrollers }) => {

await expect(elem).to.be.golden();
it(name, async() => {
const elem = await fixture(wrapScrollWrapper(html`<d2l-test-scroll-wrapper width="400" ?split-scrollers="${splitScrollers}" class="vdiff-include"></d2l-test-scroll-wrapper>`));
if (action) await action(elem);
await expect(elem).to.be.golden({ allColorModes });
});

it('split-scrollers', async() => {
const elem = await fixture(wrapScrollWrapper(html`<d2l-test-scroll-wrapper width="400" split-scrollers class="vdiff-include"></d2l-test-scroll-wrapper>`));
await focusElem(elem.querySelector('d2l-test-scroll-wrapper'));

await expect(elem).to.be.golden();
});
});

describe('print', () => {
Expand Down