-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from microsoft/dark
Adds dark mode to the site
- Loading branch information
Showing
43 changed files
with
704 additions
and
147 deletions.
There are no files selected for viewing
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
Binary file modified
BIN
-489 Bytes
(100%)
...kstop_data/bitmaps_reference/backstop_default_Empty_Page_0_document_0_phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-316 Bytes
(100%)
...stop_data/bitmaps_reference/backstop_default_Empty_Page_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-505 Bytes
(100%)
...op_data/bitmaps_reference/backstop_default_Empty_Page_0_document_2_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-117 KB
(1.4%)
...s/backstop_data/bitmaps_reference/backstop_default_Index_0_document_0_phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-112 KB
(4.1%)
.../backstop_data/bitmaps_reference/backstop_default_Index_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-114 KB
(5.4%)
...ackstop_data/bitmaps_reference/backstop_default_Index_0_document_2_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-15.5 KB
(54%)
.../bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_0_phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-144 KB
(11%)
...bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-188 KB
(8.7%)
...tmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_2_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
...aps_reference/backstop_default_Old_Handbook_Example_Dark_0_viewport_0_phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
...ps_reference/backstop_default_Old_Handbook_Example_Dark_0_viewport_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
..._reference/backstop_default_Old_Handbook_Example_Dark_0_viewport_2_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-15.4 KB
(54%)
...data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_0_phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-110 KB
(14%)
...ata/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-134 KB
(12%)
...a/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_2_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
11 changes: 11 additions & 0 deletions
11
packages/typescriptlang-org/scripts/backstop/makeDarkMode.js
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,11 @@ | ||
module.exports = async (page, scenario) => { | ||
console.log("SWITCHING TO DARK for " + scenario.label) | ||
|
||
// await page.emulateMediaFeatures([ | ||
// { | ||
// name: "prefers-color-scheme", | ||
// value: "dark", | ||
// }, | ||
// ]) | ||
// await wait() | ||
} |
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,26 @@ | ||
// @ts-check | ||
|
||
// The backstop JSON file requires setting the right paths for | ||
// screenshots - this updates them to your computer. A bit lossy | ||
// for the git history but acceptable given that mainly orta will | ||
// be running the snapshots. | ||
|
||
const { writeFileSync, readFileSync } = require("fs") | ||
const { join } = require("path") | ||
const { format } = require("prettier") | ||
|
||
const backstopPath = join(__dirname, "..", "backstop.json") | ||
const backstopJSON = JSON.parse(readFileSync(backstopPath, "utf8")) | ||
|
||
// e.g. file:///Users/ortatherox/dev/typescript/new-website/packages/typescriptlang-org/public/index.html | ||
const newPublicRoot = join(__dirname, "..", "public") | ||
backstopJSON.scenarios.forEach(scenario => { | ||
const fileToCheck = scenario.url.split("/public/")[1] | ||
const newFileURL = `file://${newPublicRoot}/${fileToCheck}` | ||
scenario.url = newFileURL | ||
}) | ||
|
||
writeFileSync( | ||
backstopPath, | ||
format(JSON.stringify(backstopJSON), { filepath: backstopPath }) | ||
) |
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
Oops, something went wrong.