From 1325f46a8f8a1708815cfbe80490cbe2208ac7cf Mon Sep 17 00:00:00 2001 From: Justin Fagnani Date: Mon, 1 Jul 2024 17:11:04 -0700 Subject: [PATCH 1/2] Add language-specific note about TypeScript decorators. --- packages/lit-dev-content/site/css/global.css | 10 ++++++++++ .../site/docs/v3/components/overview.md | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/packages/lit-dev-content/site/css/global.css b/packages/lit-dev-content/site/css/global.css index e802d7bcb..2efc986ed 100644 --- a/packages/lit-dev-content/site/css/global.css +++ b/packages/lit-dev-content/site/css/global.css @@ -80,3 +80,13 @@ a { height: 1px; overflow: hidden; } + +body[code-language-preference="ts"] [code-language]:not([code-language="ts"]) { + /* Hide JS content when preference is TS. */ + display: none; +} + +body[code-language-preference="js"] [code-language]:not([code-language="js"]) { + /* Hide TS content when preference is JS. */ + display: none; +} \ No newline at end of file diff --git a/packages/lit-dev-content/site/docs/v3/components/overview.md b/packages/lit-dev-content/site/docs/v3/components/overview.md index c365610e2..c6af5978d 100644 --- a/packages/lit-dev-content/site/docs/v3/components/overview.md +++ b/packages/lit-dev-content/site/docs/v3/components/overview.md @@ -26,3 +26,16 @@ Creating a Lit component involves a number of concepts: Here's a sample component: {% playground-example "v3-docs/components/overview/simple-greeting" "simple-greeting.ts" %} + +
+ +{% aside "info"%} + +This example uses TypeScript decorators. + +See the [Decorators](/docs/components/decorators) documentation for more information on configuring TypeScript for decorators. + +{% endaside %} + +
+ From 6b916de082a4bd777e6726ff327880f4411705f9 Mon Sep 17 00:00:00 2001 From: Justin Fagnani Date: Mon, 1 Jul 2024 17:43:28 -0700 Subject: [PATCH 2/2] Use v3 link --- packages/lit-dev-content/site/docs/v3/components/overview.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/lit-dev-content/site/docs/v3/components/overview.md b/packages/lit-dev-content/site/docs/v3/components/overview.md index c6af5978d..9428d4981 100644 --- a/packages/lit-dev-content/site/docs/v3/components/overview.md +++ b/packages/lit-dev-content/site/docs/v3/components/overview.md @@ -33,9 +33,8 @@ Here's a sample component: This example uses TypeScript decorators. -See the [Decorators](/docs/components/decorators) documentation for more information on configuring TypeScript for decorators. +See the [Decorators](/docs/v3/components/decorators) documentation for more information on configuring TypeScript for decorators. {% endaside %} -