diff options
author | 2021-05-27 09:16:14 -0500 | |
---|---|---|
committer | 2021-05-27 09:16:14 -0500 | |
commit | 5247a23cbe534d79cdf4abe4c200a351dddc5dc2 (patch) | |
tree | 343c54fb5471998b4e1a9150d15ba63028548928 /examples/doc/src/components/Note.astro | |
parent | 19dc517b87c3b6ad90c97bd220fe96becf27b196 (diff) | |
download | astro-5247a23cbe534d79cdf4abe4c200a351dddc5dc2.tar.gz astro-5247a23cbe534d79cdf4abe4c200a351dddc5dc2.tar.zst astro-5247a23cbe534d79cdf4abe4c200a351dddc5dc2.zip |
Example: Docs template (#226)
* fix: markdown issues
* wip: add docs example
* example: update doc template
* chore: credit Steph for AvatarList
* chore: align footer to bottom viewport
* chore: feeback R1
* fix: font fallback in firefox
* fix merge conflicts
* fix: add default value to headers
* chore: fix doc example
Diffstat (limited to 'examples/doc/src/components/Note.astro')
-rw-r--r-- | examples/doc/src/components/Note.astro | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/examples/doc/src/components/Note.astro b/examples/doc/src/components/Note.astro new file mode 100644 index 000000000..46940ddf8 --- /dev/null +++ b/examples/doc/src/components/Note.astro @@ -0,0 +1,49 @@ +--- +export let type = "tip"; +export let title; +--- + +<aside class={`note type-${type}`}> + {title && <label>{title}</label>} + <slot /> +</aside> + +<style> + .note { + --padding-block: 1rem; + --padding-inline: 1.25rem; + + display: flex; + flex-direction: column; + + padding: var(--padding-block) var(--padding-inline); + margin-left: calc(var(--padding-inline) * -1); + margin-right: calc(var(--padding-inline) * -1); + + background: var(--theme-bg-offset); + border-left: calc(var(--padding-inline) / 2) solid var(--color); + border-radius: 0; + } + + .note label { + font-weight: 500; + color: var(--color); + } + + /* .note :global(a) { + color: var(--color); + } */ + + .note.type-tip { + --color: var(--color-green); + --color-rgb: var(--color-green-rgb); + } + .note.type-warning { + --color: var(--color-yellow); + --color-rgb: var(--color-yellow-rgb); + } + .note.type-error { + --color: var(--color-red); + --color-rgb: var(--color-red-rgb); + } +</style> |