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

Working with state classes

Offen
#273 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
2k
Forks
159
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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...

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Das Issue nennt die Verwendung von styleName und verschachtelte CSS-Selektoren, aber keine Repository-Dateien oder Tests. Beginne damit, den Einstiegspunkt der styleName-Transformation und vorhandene Tests zur Selektorauflösung zu finden; abgeschlossen ist die Aufgabe, wenn vorangestellte Zustandsklassen wie is- und u- ignoriert werden können, während verschachtelte menu__item/menu__icon-Selektoren wie gezeigt aufgelöst werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
babel, css, javascript
Bereich
frontend, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.