Skip to content

Commit 77c4e12

Browse files
committed
update readme to match our css selector conventions since we are using vue not react
1 parent af8e8b2 commit 77c4e12

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

README.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,33 +140,48 @@ We recommend a variant of BEM with PascalCased “blocks”, which works particu
140140
**Example**
141141

142142
```jsx
143-
// ListingCard.jsx
144-
function ListingCard() {
145-
return (
146-
<article class="ListingCard ListingCard--featured">
143+
// ListingCard.vue
144+
<template>
145+
<article class="listing-card listing-card--featured">
146+
<h1 class="listing-card__title">Happy kids Wonderschool</h1>
147+
148+
<div class="listing-card__content">
149+
<p>Vestibulum id ligula porta felis euismod semper.</p>
150+
<small class="listing-card__comment">This is a small comment.</small>
151+
</div>
152+
</article>
153+
</template>
154+
155+
<script>
156+
export default {};
157+
</script>
158+
159+
<style lang="scss" scoped>
160+
.listing-card {
161+
// ...
147162

148-
<h1 class="ListingCard__title">Adorable 2BR in the sunny Mission</h1>
163+
&--featured {
164+
// ...
165+
}
149166

150-
<div class="ListingCard__content">
151-
<p>Vestibulum id ligula porta felis euismod semper.</p>
152-
</div>
167+
&__title {
168+
// ...
169+
}
153170

154-
</article>
155-
);
156-
}
157-
```
171+
&__content {
172+
// ...
173+
}
158174

159-
```css
160-
/* ListingCard.css */
161-
.ListingCard { }
162-
.ListingCard--featured { }
163-
.ListingCard__title { }
164-
.ListingCard__content { }
175+
&__comment {
176+
// ...
177+
}
178+
}
179+
</style>
165180
```
166181

167-
* `.ListingCard` is the “block” and represents the higher-level component
168-
* `.ListingCard__title` is an “element” and represents a descendant of `.ListingCard` that helps compose the block as a whole.
169-
* `.ListingCard--featured` is a “modifier” and represents a different state or variation on the `.ListingCard` block.
182+
* `.listing-card` is the “block” and represents the higher-level component
183+
* `.listing-card__title` is an “element” and represents a descendant of `.ListingCard` that helps compose the block as a whole.
184+
* `.listing-card--featured` is a “modifier” and represents a different state or variation on the `.ListingCard` block.
170185

171186
### ID selectors
172187

0 commit comments

Comments
 (0)