Skip to content

Commit fa1072f

Browse files
add docs
1 parent cd784f7 commit fa1072f

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
defaults: &defaults
44
working_directory: ~/postcss-themed
55
docker:
6-
- image: circleci/node:8.14-browsers
6+
- image: circleci/node:10-browsers
77
environment:
88
TZ: '/usr/share/zoneinfo/America/Los_Angeles'
99

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,45 @@ See [PostCSS] docs for examples for your environment.
113113
}
114114
```
115115

116+
### Theming with Objects
117+
118+
You can even keep theme values in deeply nested objects.
119+
120+
**Input:**
121+
122+
```js
123+
const config = {
124+
default: {
125+
colors: {
126+
primary: 'white',
127+
},
128+
},
129+
other: {
130+
colors: {
131+
primary: 'black',
132+
},
133+
},
134+
};
135+
```
136+
137+
```css
138+
.foo {
139+
color: @theme colors.primary;
140+
}
141+
```
142+
143+
**Output:**
144+
145+
```css
146+
.foo {
147+
color: white;
148+
}
149+
150+
.other .foo {
151+
color: black;
152+
}
153+
```
154+
116155
### Component themes
117156

118157
Define a component level theme in either commonjs or typescript. A file names `themes.(js|ts)` must be co-located with the themeable CSS file.

0 commit comments

Comments
 (0)