Published
Edited
Feb 22, 2021
1 fork
5 stars
Insert cell
Insert cell
feather = require("feather-icons") // https://www.npmjs.com/package/feather-icons
Insert cell
Insert cell
Insert cell
leadContent = `[${feather.icons.feather.toSvg()}](https://feathericons.com "Homepage") is a collection of **${Object.keys(feather.icons).length}** MIT-licensed icons by Cole Bemis et al.`
Insert cell
listAlphabetically = () => {
let table = `
|24px|16px|Name|Description|
|:--:|:--:|:---|:----------|
`;

for (const [name, icon] of Object.entries(feather.icons)) {
const nativelySized = icon.toSvg(); // each icon is designed on a 24x24 grid
const smallerSized = icon.toSvg({ width: 16, height: 16 });
const description = icon.tags.join(", ");
table += `|${nativelySized}|${smallerSized}|${name}|${description}|\n`;
}
return md`${table}`;
}
Insert cell
html`<style>
th,
td {
padding: 4px;
}

.feather {
vertical-align: middle;
}

a .feather {
stroke: #c4c4c4; /* Observable's moon-gray */
}

a:hover .feather {
stroke: #3b5fc0; /* Observable's blue */
}
</style>`
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