@pjack/styled-elements
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

styled-elements

This is a shameless copy of styled-components, but it creates plain HTMLElement instances instead of React components.

Here's a quick example:

import { styled } from "styled-elements"

const H1 = styled("h1")`
  font-family: impact;
  font-size: 72pt;
`

const element = H1()
element.innerText = "Hello, world!"
document.body.appendChild(element)

You can also specify attributes in the factory:

const EmailField = styled("input", {type:"email"})`
  font-family:monospaced;
`

Or specify them when using the factory to create an element:

const element = EmailField({id:"email-field"})

Readme

Keywords

none

Package Sidebar

Install

npm i @pjack/styled-elements

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

5.28 kB

Total Files

5

Last publish

Collaborators

  • pjack