Skip to content

Commit

Permalink
Add language-specific note about TypeScript decorators. (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani authored Jul 2, 2024
1 parent fb937bb commit 9db43a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/lit-dev-content/site/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
12 changes: 12 additions & 0 deletions packages/lit-dev-content/site/docs/v3/components/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ 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" %}

<div code-language="ts">

{% aside "info"%}

This example uses TypeScript decorators.

See the [Decorators](/docs/v3/components/decorators) documentation for more information on configuring TypeScript for decorators.

{% endaside %}

</div>

0 comments on commit 9db43a0

Please sign in to comment.