diff options
author | 2023-07-01 16:34:49 +0200 | |
---|---|---|
committer | 2023-07-01 16:34:49 +0200 | |
commit | bc9ce779d3c02e7a960a8a79ce2610a96b2afcb7 (patch) | |
tree | ca98857efd8c7e26786d45d21fa220f89646f128 /packages/integrations/lit/README.md | |
parent | 0251e4e6cf512967e2421c2389aafef17fb89b79 (diff) | |
download | astro-bc9ce779d3c02e7a960a8a79ce2610a96b2afcb7.tar.gz astro-bc9ce779d3c02e7a960a8a79ce2610a96b2afcb7.tar.zst astro-bc9ce779d3c02e7a960a8a79ce2610a96b2afcb7.zip |
Move code block titles into comments to match docs (#7543)
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | packages/integrations/lit/README.md | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/integrations/lit/README.md b/packages/integrations/lit/README.md index 570b49211..1a71ce3c6 100644 --- a/packages/integrations/lit/README.md +++ b/packages/integrations/lit/README.md @@ -42,9 +42,8 @@ npm install lit @webcomponents/template-shadowroot Now, apply this integration to your `astro.config.*` file using the `integrations` property: -**`astro.config.mjs`** - -```js ins={2} "lit()" +```js ins={3} "lit()" +// astro.config.mjs import { defineConfig } from 'astro/config'; import lit from '@astrojs/lit'; @@ -66,9 +65,8 @@ However, there's a key difference with Lit _custom elements_ over conventional _ Astro needs to know which tag is associated with which component script. We expose this through exporting a `tagName` variable from the component script. It looks like this: -**`src/components/my-element.js`** - ```js +// src/components/my-element.js import { LitElement, html } from 'lit'; const tagName = 'my-element'; @@ -86,10 +84,9 @@ customElements.define(tagName, MyElement); In your Astro template import this component as a side-effect and use the element. -**`src/pages/index.astro`** - ```astro --- +// src/pages/index.astro import { MyElement } from '../components/my-element.js'; --- |