Skip to content

Commit fac4530

Browse files
jss-syntax documentation for high specificity
Document more uses for `&` when dealing with high specificity selectors
1 parent 2b54776 commit fac4530

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

docs/jss-syntax.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,31 @@ Compiles to:
338338
}
339339
```
340340

341+
## Specific selectors
342+
343+
When extending third party libraries with high secificity selector it's often necessary to have also have a high specificity.
344+
345+
```javascript
346+
347+
const styles = {
348+
button: {
349+
'.button &': {
350+
color: 'red'
351+
}
352+
}
353+
}
354+
355+
```
356+
357+
Compiles to:
358+
359+
```css
360+
.button .button-0 {
361+
color: 'red'
362+
}
363+
```
364+
365+
341366
## Working with colors
342367

343368
You can use any color conversion tool, e.g. [this one](https://yarnpkg.com/en/package/color).

0 commit comments

Comments
 (0)