From 989772c8d8f257b9d11b9e51a69271510e92cca6 Mon Sep 17 00:00:00 2001 From: Orta Date: Wed, 5 Aug 2020 09:50:31 -0400 Subject: [PATCH 1/7] Improve the 'in your lang' UI --- .../src/components/layout/LanguageRecommendation.tsx | 3 ++- packages/typescriptlang-org/src/components/layout/TopNav.scss | 1 - packages/typescriptlang-org/src/components/layout/TopNav.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/typescriptlang-org/src/components/layout/LanguageRecommendation.tsx b/packages/typescriptlang-org/src/components/layout/LanguageRecommendation.tsx index 8f73bf62ad09..024242fd1a65 100644 --- a/packages/typescriptlang-org/src/components/layout/LanguageRecommendation.tsx +++ b/packages/typescriptlang-org/src/components/layout/LanguageRecommendation.tsx @@ -59,7 +59,7 @@ export const LanguageRecommendations = (props: Props) => { if (localePath === "") localePath = "/" if (localePath === location.pathname) return - const doesPageExist = props.allSitePage.nodes.find(f => f.path === localePath) + const doesPageExist = props.allSitePage.nodes.find(f => f.path === localePath || f.path + "/" === localePath) if (!doesPageExist) return //@ts-ignore @@ -73,6 +73,7 @@ export const LanguageRecommendations = (props: Props) => { quickJumpA.textContent = lang.shorthand quickJumpA.href = localePath + quickJump.title = lang.body quickJump.style.display = "inline-block"; // Adding the LI somehow makes the search bump up by 2px diff --git a/packages/typescriptlang-org/src/components/layout/TopNav.scss b/packages/typescriptlang-org/src/components/layout/TopNav.scss index ee8a297e8716..d01212cd9dfd 100644 --- a/packages/typescriptlang-org/src/components/layout/TopNav.scss +++ b/packages/typescriptlang-org/src/components/layout/TopNav.scss @@ -173,7 +173,6 @@ form.search { background-color: $ts-main-blue-darker-color; color: white; border: none; - height: 1.6rem; border-radius: 0; &:hover, diff --git a/packages/typescriptlang-org/src/components/layout/TopNav.tsx b/packages/typescriptlang-org/src/components/layout/TopNav.tsx index 6429702e1eeb..45c182e860bc 100644 --- a/packages/typescriptlang-org/src/components/layout/TopNav.tsx +++ b/packages/typescriptlang-org/src/components/layout/TopNav.tsx @@ -74,7 +74,7 @@ export const SiteNav = (props: Props) => {
  • {i("nav_documentation_short")}
  • {i("nav_handbook")}
  • {i("nav_community")}
  • -
  • {i("nav_playground")}
  • +
  • {i("nav_playground")}
  • {i("nav_tools")}
  • From 70d77d2c5c1a428a277f7fea1b6b9c6df8e661f8 Mon Sep 17 00:00:00 2001 From: Orta Date: Wed, 5 Aug 2020 11:39:20 -0400 Subject: [PATCH 2/7] Use a lighter version of cascadia mono --- .../copy/en/handbook-v1/Basic Types.md | 15 ++++++------ .../src/components/layout/SiteFooter.scss | 3 ++- .../src/components/layout/SiteFooter.tsx | 23 +++++++++--------- .../src/components/layout/fonts.scss | 4 +-- .../typescriptlang-org/src/style/globals.scss | 2 +- .../src/templates/markdown-twoslash.scss | 8 +++--- .../static/fonts/CascadiaMono-SemiLight.woff2 | Bin 0 -> 55452 bytes .../static/fonts/CascadiaMono.woff2 | Bin 59216 -> 0 bytes 8 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 packages/typescriptlang-org/static/fonts/CascadiaMono-SemiLight.woff2 delete mode 100644 packages/typescriptlang-org/static/fonts/CascadiaMono.woff2 diff --git a/packages/documentation/copy/en/handbook-v1/Basic Types.md b/packages/documentation/copy/en/handbook-v1/Basic Types.md index d2cf4fd66cba..34124897ff8f 100644 --- a/packages/documentation/copy/en/handbook-v1/Basic Types.md +++ b/packages/documentation/copy/en/handbook-v1/Basic Types.md @@ -16,7 +16,7 @@ The most basic datatype is the simple true/false value, which JavaScript and Typ let isDone: boolean = false; ``` -## Number +## Number As in JavaScript, all numbers in TypeScript are either floating point values or BigIntegers. These floating point numbers get the type `number`, while BigIntegers get the type `bigint`. @@ -383,7 +383,6 @@ You may have noticed that so far, we've been using the `let` keyword instead of The `let` keyword is actually a newer JavaScript construct that TypeScript makes available. You can read in the Handbook Reference on [Variable Declarations](/docs/handbook/variable-declarations.html) more about how `let` and `const` fix a lot of the problems with var. - ## About `Number`, `String`, `Boolean`, `Symbol` and `Object` It can be tempting to think that the types `Number`, `String`, `Boolean`, `Symbol`, or `Object` are the same as the lowercase versions recommended above. @@ -391,19 +390,19 @@ These types do not refer to the language primitives however, and almost never sh ```ts twoslash // @errors: 2339 -function reverse(s: String): String { - return s.split("").reverse().join("") +function reverse(s: String): String { + return s.split("").reverse().join(""); } -reverse("hello world") +reverse("hello world"); ``` Instead, use the types `number`, `string`, `boolean`, `object` and `symbol`. ```ts twoslash -function reverse(s: string): string { - return s.split("").reverse().join("") +function reverse(s: string): string { + return s.split("").reverse().join(""); } -reverse("hello world") +reverse("hello world"); ``` diff --git a/packages/typescriptlang-org/src/components/layout/SiteFooter.scss b/packages/typescriptlang-org/src/components/layout/SiteFooter.scss index 256ff0ba0778..3cf123adc1da 100644 --- a/packages/typescriptlang-org/src/components/layout/SiteFooter.scss +++ b/packages/typescriptlang-org/src/components/layout/SiteFooter.scss @@ -68,7 +68,8 @@ } section#switcher { - border-top: 1px solid rgba(255, 255, 255, 0.3); + border-bottom: 1px solid rgba(255, 255, 255, 0.3); + article { h3 { width: 240px; diff --git a/packages/typescriptlang-org/src/components/layout/SiteFooter.tsx b/packages/typescriptlang-org/src/components/layout/SiteFooter.tsx index f4acaf4717c3..85543a06f4cd 100644 --- a/packages/typescriptlang-org/src/components/layout/SiteFooter.tsx +++ b/packages/typescriptlang-org/src/components/layout/SiteFooter.tsx @@ -241,17 +241,6 @@ export const SiteFooter = (props: Props) => { return (