// These types are brief and correct, but lose autocomplete support because of the string union :/
export type ColorProps = {
/** sets background color with design system or generic value */
bgColor?: DesignSystemColor | string;
/** sets color with design system or generic value */
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
[ | |
"almond", | |
"caramel", | |
"blackberry", | |
"brown sugar", | |
"candied orange", | |
"chocolate", | |
"clean", | |
"cocoa", | |
"dried cherry", |
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
[ | |
{ | |
"country": "Burundi", | |
"region": "Africa", | |
"subRegions": ["Buyenzi", "Bweru"] | |
}, | |
{ | |
"country": "Ethiopia", | |
"region": "", | |
"subRegions": ["Harrar", "Jimma", "Limu", "Sidamo", "Yirgacheffe"] |
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
[ | |
{ | |
"firstName": "Alan", | |
"lastName": "Smith" | |
} | |
] |
Using Layout and Typography Components
- [Design Systems][1] by Alla Kholmatova - the canonical design systems book, in my opinion
- [Expressive Design Systems][2] by Yesenia Perez-Cruz - a great follow-up to Kholmatova's book
- [Atomic Design][3] by Brad Frost - written before we were using the term 'design system' for web interfaces, but many popular ideas extend from these ideas
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
function sign(name, fontSize = 96) { | |
// assumes the id of the canvas element is 'canvas' | |
const canvas = document.getElementById('canvas') | |
const ctx = canvas.getContext('2d'); | |
ctx.font = `italic ${fontSize}px Snell Roundhand`; | |
const signatureWidth = ctx.measureText(name).width; | |
const x = canvas.width/2 - signatureWidth/2; | |
const y = canvas.height/2 + fontSize/2; | |
ctx.fillStyle = ctx.strokeStyle; | |
ctx.fillText(name, x, y); |