I’m trying to embed cells from this notebook into a Jekyll blog. The embed had styling a few days ago but now it doesn’t. I made changes but unsure what exactly caused it to lose styling. Any ideas?
So what’s happening here is that the style cell isn’t referenced by your chart and thus isn’t being rendered. Here are two options:
Copy the contents of the style cell and include it in your HTML either via a <link rel="stylesheet"> tag in the head (if you save the styles to a separate .css file) or by putting the styles in a <style> tag.
Or you can first name the style cell in your notebook e.g.:
myStyles = html`
<style>
/* ...
and then make sure that cell is rendered in your embed code:
<div id="observablehq-2663ced7"></div>
<script type="module">
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import define from "https://api.observablehq.com/@rayshan/unicorn-startup-ipo-leader-board.js?v=3";
const inspect = Inspector.into("#observablehq-2663ced7");
(new Runtime).module(define, name => (name === "chart" || name === "myStyles") && inspect());
</script>
Hope that helps and welcome to the forums, by the way!
On the first time a person visits the webpage, the embed does not load. All subsequent visits, the embed appears without issue, but never on a user’s first visit.
I would like to use Observable’s default CSS, but I cannot get it to load. I attempted to link it in a separate <style> tag as mentioned in this post, but that does not seem to do the trick for me.
Console for reference. Unfortunately, I don’t know what these warnings mean.