-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:sass/sass-site into playground-color
- Loading branch information
Showing
7 changed files
with
283 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {SplitView} from '@spectrum-web-components/split-view'; | ||
import '@spectrum-web-components/split-view/sp-split-view.js'; | ||
|
||
/** | ||
* Make split views responsive and stack vertically on narrow screens. | ||
*/ | ||
export default function setUpSplitView(): void { | ||
// 60em = --sl-breakpoint--large | ||
const mql = window.matchMedia('(max-width: 60em'); | ||
const topSplit = document.querySelector('.sl-c-playground') as SplitView; | ||
|
||
function updateLayout(event: MediaQueryListEvent | MediaQueryList): void { | ||
if (topSplit) topSplit.vertical = event.matches; | ||
} | ||
updateLayout(mql); | ||
mql.addEventListener('change', updateLayout); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.