Skip to content

Commit 0b93648

Browse files
committed
added faq
1 parent ecb1615 commit 0b93648

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ variable](https://github.com/styled-components/styled-components/blob/master/doc
2525
but:
2626

2727
1. Having `${(props) => props.theme.highlight}` functions all over your template literals to use
28-
any of your theme colors is both hard to read and cumbersome to type.
28+
any of your theme colors is both hard to read and cumbersome to type.
2929

3030
2. In migrating from SASS and CSS Modules, I missed the ability to `lighten()` or `darken()` or
31-
`transparentize()` a theme color at will to make subtle gradients or overlays.
31+
`transparentize()` a theme color at will to make subtle gradients or overlays.
3232

3333
---
3434

@@ -136,4 +136,22 @@ theme.color.rotate(-90) // hsl(60, 20%, 20%) -> hsl(330, 20%, 20%)
136136
137137
---
138138
139-
Made with ❤️ in 🇪🇸.by [@erikras](https://twitter.com/erikras).
139+
## FAQ
140+
141+
### Why use `color`? Why not [other color manipulation library]?
142+
143+
Because `color`'s manipulation methods were so influenced by SASS, LESS and
144+
Stylus, they are already familiar to CSS coders.
145+
146+
### Isn't `Color` mutable? Don't I need to `clone()`?
147+
148+
Yes, `Color` is mutable, but this library handles the cloning for you, so
149+
you can chain the manipulation methods together to your heart's content
150+
without mutating the original theme color. e.g.
151+
`theme.primary.saturate(0.3).lighten(0.2).clearer(0.4)`.
152+
153+
**The manipulation methods in `styled-components-theme` are *immutable***.
154+
155+
---
156+
157+
Made by [@erikras](https://twitter.com/erikras) in 🇪🇸 with ❤️.

0 commit comments

Comments
 (0)