Published
Edited
Oct 5, 2020
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
outer_css = shadow.css`
section { background-color: darkgreen; color: white; padding: 10px; }
`
Insert cell
inner_css = shadow.css`
section { background-color: darkred; color: white; padding: 10px; }
`
Insert cell
render(jsx`
<${shadow.div} styleSheets=${[outer_css]}>
<section>
<b>Outside</b>
<${shadow.div}
slots=${{
stuff: jsx`<section class="Slotted">Inside, but still outside</section>`
}}
styleSheets=${[inner_css]}
>
<section>
<b>Header</b>
<slot
name="stuff"
/>
<b>Footer</b>
</section>
</${shadow.div}>
<b>Outside Footer</b>
</${shadow.div}>
</section>
`)
Insert cell
Insert cell
async_style = shadow.css.async`
@import url('https://fonts.googleapis.com/css2?family=Yellowtail&display=swap');

section {
font-family: Yellowtail;
}
`
Insert cell
render(jsx`
<${shadow.div} styleSheets=${[async_style]}>
<section>Didn't work just yet, sad :(</section>
</${shadow.div}>
`)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more