Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language-specific note about TypeScript decorators. #1345

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't see that. I had started making a new component before I looked into how switchable sample worked and figured that plain CSS was just easier.

/* 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>
Loading