generated from Princesseuh/component-template
-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chris/baseline-status
- Loading branch information
Showing
8 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
import * as Component from 'astro-embed'; | ||
import Base from '../layouts/Base.astro'; | ||
--- | ||
|
||
<Base title="Twitter component examples with dark theme"> | ||
<p> | ||
These tweets use the same component code as the <a href="/twitter" | ||
>main Twitter example</a | ||
>, but also loads Twitter’s widget JavaScript to convert them to interactive | ||
iframes and use dark theme: | ||
</p> | ||
<pre><code set:text={'<script async src="https://platform.twitter.com/widgets.js"></script>'} /></pre> | ||
<Component.Tweet | ||
theme="dark" | ||
id="https://twitter.com/astrodotbuild/status/1511750228428435457" | ||
/> | ||
<Component.Tweet | ||
theme="dark" | ||
id="https://twitter.com/astrodotbuild/status/1511380091720409095" | ||
/> | ||
<Component.Tweet | ||
theme="dark" | ||
id="https://twitter.com/astrodotbuild/status/1509917444403601409" | ||
/> | ||
<p class="center">…</p> | ||
<Component.Tweet | ||
theme="dark" | ||
id="https://twitter.com/astrodotbuild/status/1402352777020395521" | ||
/> | ||
|
||
<script async src="https://platform.twitter.com/widgets.js"></script> | ||
</Base> | ||
|
||
<style> | ||
body { | ||
color-scheme: dark; | ||
background-color: #101010; | ||
color: #fff; | ||
} | ||
.center { | ||
text-align: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Dark theme Tweet with JavaScript | ||
description: Example of loading Twitter’s widget JavaScript to hydrate the Astro Embed Tweet component using a dark color theme | ||
template: splash | ||
toc: false | ||
--- | ||
|
||
import { LinkCard } from '@astrojs/starlight/components'; | ||
import { Tweet } from '@astro-community/astro-embed-twitter'; | ||
|
||
Adding Twitter’s widget script will hydrate the HTML markup of `<Tweet>`. | ||
|
||
```astro | ||
<script src="https://platform.twitter.com/widgets.js"></script> | ||
<Tweet theme="dark" id="https://twitter.com/astrodotbuild/status/1632809919291457537" /> | ||
``` | ||
|
||
The above code produces the following result: | ||
|
||
<script src="https://platform.twitter.com/widgets.js"></script> | ||
|
||
<Tweet theme="dark" id="https://twitter.com/astrodotbuild/status/1632809919291457537" /> | ||
|
||
<LinkCard title="See full Tweet docs" href="/components/twitter/" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters