Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Explain why dapper is different than other libraries #41

Open
RylanH opened this issue Apr 8, 2017 · 0 comments
Open

Explain why dapper is different than other libraries #41

RylanH opened this issue Apr 8, 2017 · 0 comments

Comments

@RylanH
Copy link
Contributor

RylanH commented Apr 8, 2017

Why is it better than https://github.com/styled-components/styled-components, http://fela.js.org/?
We prefer Javascript css properties instead of CSS syntax since we frequently pull values from other shared grid system and type hierarchy

{
  ...Type.FontSizes.SMALL,
  padding: Sizes.GRID_UNIT,
}

We also prefer separating determination of a mode from the styling for it. For one, it lets us compile all styles up front and just switch between them. Second, if the number of styles per prop is anything larger than 2, its becomes awkward:

  padding: ${props => props.size === Sizes.SMALL ? 6 : props.size === Size.LARGE ? 8 : props.size === Size.XLARGE ? 10 : 4}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant