Creates a stylus component with the stylus code and accepts an optional argument displayName.
Example
const Button = stylus(
`
button-styles(radius, size, color, type)
border-radius radius
border size type color
color mistyrose
background-color white
button
button-styles(3px, 2px, mistyrose, solid)
`,
{ displayName: 'ButtonComponent' }
);Loads the given font-face and returns the font family name
Example
const Fira = fontFace(`
@font-face
font-family FiraCode
font-style normalize
src url(./FiraCode-Retina.ttf)
`);
const Name = stylus(`
h2
font-family ${Fira}
`, { displayName: 'Name' });loads the animation keyframes and returns an animation name
Example
const fadeIn = keyframes(`
animation-name = fadeIn
@keyframes animation-name
for i in 0..10
{10% * i}
opacity (i/10)
`);
const FadeInButton = stylus(
`
button
animation ${fadeIn} 4s ease-out
`,
{ displayName: "FadeInButton" }
);
