Skip to content

Commit 2062726

Browse files
committed
Add a proposal for an improved modifier concept.
+ adds the is- and has- prefix improving recognation of modifiers + represents the current standard in zweitag projects + allows a wider range of modifiers (e.g. has-submenu instead of submenued)
1 parent 0d5e819 commit 2062726

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ Varianten und Status einer Komponente werden mit Modifier abgebildet. Sie treten
9494

9595
#### Beispiele
9696

97-
`.button.primary`, `.text-link.unobtrusive`, `.product-list--entry.sold-out`, `.button.primary.disabled`
97+
`.button.is-primary`, `.text-link.is-unobtrusive`, `.product-list--entry.is-sold-out`, `.button.primary.is-disabled`
9898

9999
#### Eigenschaften des Namens
100100

101101
* beschreibt einen Zustand oder besonderes Verhalten einer Komponenteninstanz, wodurch eine Variante entsteht
102-
* ist idealerweise ein einfaches Adjektiv
102+
* ist idealerweise ein einfaches Adjektiv mit dem Prefix `is-` oder `has-`
103+
* die Prefixe werden benötigt, damit ein Modifier einfach identifiziert werden kann und auch Zustände ohne einfaches Adjektiv abgebildet werden können
103104
* steht nie alleine, sondern ist nur in Verbindung mit der Komponente eindeutig ([Warum?](https://github.com/zweitag/html-css-guidelines/pull/2#discussion_r123475470))
104105

105106
### Block, Element, Modifier (BEM)
@@ -130,7 +131,7 @@ Die Syntax von BEM finden wir jedoch etwas sperrig und haben uns für ein andere
130131
<pre lang="haml">
131132
%ul.fact-list
132133
%li.fact-list--entry
133-
%li.fact-list--entry.highlighted
134+
%li.fact-list--entry.is-highlighted
134135
</pre>
135136
</td>
136137
</tr>
@@ -151,7 +152,7 @@ Die Syntax von BEM finden wir jedoch etwas sperrig und haben uns für ein andere
151152
list-style-type: disc
152153
.fact-list--entry
153154
line-height: 1.2
154-
&.highlighted
155+
&.is-highlighted
155156
font-weight: 700
156157
</pre>
157158
</td>

sass-style-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ Verschachtelungen innerhalb eines Elements beginnen mit Pseudoklassen, gefolgt v
7878
border-color: $color-border-loud
7979
&::before
8080
content: '*'
81-
&.highlighted
81+
&.is-highlighted
8282
background-color: $color-background-loud
8383
8484
.main-navigation--link
8585
display: block
8686
padding: 5px 0
87-
.main-navigation--item.highlighted &
87+
.main-navigation--item.is-highlighted &
8888
color: $color-text-inverted
8989
```
9090

0 commit comments

Comments
 (0)