1.4.0 • Published 5 years ago

stencil-styled-components v1.4.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Stencil Styled-Components

Small library to bring the concept of styled-components to StencilJS.

Installation

npm i stencil-styled-components

Usage

import { Component } from '@stencil/core'
import styled from 'stencil-styled-components'

const StyledDiv = styled.div`
  display: inline-block;
  background-color: ${props => props.invert ? 'black' : 'white'};
  color: ${props => props.invert ? 'white' : 'black'};
  width: 100px;
  height: 100px;

  &:hover {
    border: 1px solid #448aff;
  }
`

@Component({
  tag: 'my-component'
})
export class MyComponent {
  render() {
    return (
      <div>
        <StyledDiv>
          <span>Hey, I'm styled!</span>
        </StyledDiv>
        <StyledDiv invert>
          <span>Hey, I'm inverted with a prop!</span>
        </StyledDiv>
      </div>
    )
  }
}
1.4.0

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago