An open API service indexing awesome lists of open source software.

https://github.com/danilowoz/my-styled-component

💅 My own implementation of styled-components within 100 lines of code.
https://github.com/danilowoz/my-styled-component

Last synced: 5 months ago
JSON representation

💅 My own implementation of styled-components within 100 lines of code.

Awesome Lists containing this project

README

          

# my-styled-component

💅 My own implementation of styled-components within 100 lines of code.

## Usage

```jsx
const SECTION_WIDTH = 400;

const Section = styled.section`
width: ${SECTION_WIDTH}px;
`;

const Bold = styled.strong`
font-weight: bold;
`;

const Text = styled.p`
color: ${props => props.color};
font-size: 16px;
text-align: center;

${({ active }) =>
active &&
css`
text-decoration: underline;
text-transform: ${({ color }) => {
return color === "red" ? "uppercase" : "none";
}};
`}

strong,
span {
color: #000;
font-weight: normal;
}

${Bold} {
font-size: 20px;
}
`;

Foo Foo strong

```

## Dependencies

- `html-tags`: List of standard HTML tags;
- `stylis`: light–weight css preprocessor;