Skip to content

Instantly share code, notes, and snippets.

View DopamineDriven's full-sized avatar
🎯
cloud hopping

Andrew Ross DopamineDriven

🎯
cloud hopping
View GitHub Profile
export interface IconDefinition extends IconLookup {
icon: [
number, // width
number, // height
string[], // ligatures
string, // unicode
IconPathData // svgPathData -> string | string[]
];
}
@DopamineDriven
DopamineDriven / example.ts
Created August 20, 2020 07:42
Example of CustomIcon
const CustomIconExample: IconDefinition & IconLookup = {
prefix: 'fab',
iconName: 'example-icon',
icon: [
64, // viewBox width
64, // viewBox height
[], // ligatures
'#000000', // fill/fillColor
'M24 22.525H0' // iconPath(s)
]
[min-x min-y width height]
import {
library,
IconDefinition,
IconLookup
} from '@fortawesome/fontawesome-svg-core';
@DopamineDriven
DopamineDriven / vercel.html
Created August 20, 2020 07:47
Vercel Icon
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
focusable="false"
width="1em"
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"
@DopamineDriven
DopamineDriven / vercel-refactored.html
Created August 20, 2020 07:50
Figma refactored Vercel SVG
<svg
width="1"
height="1"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0)">
<path d="M1 0.938607H0L0.5 0.0615234L1 0.938607Z" fill="#626262" />
</g>
export const faCustomVercelIcon: IconDefinition & IconLookup = {
prefix: 'fab',
iconName: 'vercel-icon',
icon: [
24,
24,
[],
'none',
'M24 22.525H0l12-21.05l12 21.05z'
]
@DopamineDriven
DopamineDriven / fas-custom-integration.ts
Created August 20, 2020 07:53
step 5 ft library.add()
export const faCustomVercelIcon: IconDefinition & IconLookup = {
prefix: 'fab',
iconName: 'vercel-icon',
icon: [
24,
24,
[],
'none',
'M24 22.525H0l12-21.05l12 21.05z'
]
@DopamineDriven
DopamineDriven / index.d.ts
Created August 20, 2020 07:55
fontawesome-common-types IconName type addition
export type IconName = 'vercel-icon' | '500px' |
'accessible-icon' |
'accusoft' |
'acquisitions-incorporated' |
// ...7,846 lines later...
'wrench' |
'x-ray' |
'yen-sign' |
'yin-yang';
@DopamineDriven
DopamineDriven / index.d.ts
Created August 20, 2020 07:56
IconPrefix type manipulation
export type IconPrefix = "fas" | "fab" | "fac" | "far" | "fal" | "fad";