gajus / gajus/babel-plugin-react-css-modules

Working with state classes

Aperta
#273 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2k
Fork
159
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

We are using this library in 2 of our projects and works really well.
But one of the practices that we usually use are "State classes" like http://smacss.com/book/type-state

for example if we have
```


```

this element can sometimes have this class
```


```

To try to style things like this we had to use multiple modules and have a CSS like:
```
.menu__item {
color: red;
}

.is-active {
color: blue;
}
```

ideally we would like to use
```
.menu__item {
color: red;

&.is-active {
color: blue;
}
}
```

But ok we can more or less work, the problem is when you have something inside `menu__item`
```




```

In that case we cannot do that:
```
.menu__item {
color: red;
}

.is-active {
color: blue;

.menu__icon {
color: yellow;
}
}
```
or ideally:

```
.menu {
&__item {
color: red;

&.is-active {
color: blue;
}
}

&__item.is-active &__icon {
color: yellow;
}
}
```

Are you planning some feature to "disable" selectors that start with a prefix?
For example, for us can be useful to ignore "is-", "u-", etc...

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.