Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 366ce28

Browse files
committed
Reverse the use of @extend in a code example
1 parent 35af6e1 commit 366ce28

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

css/sass-best-practices/readme.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,21 @@ This is how we deal with this scenario using `@extend`:
134134
// In `/vellum`
135135
// ---
136136

137-
h1 {
138-
@extend %c-heading-1;
137+
h1,
138+
h2,
139+
// etc.
140+
%headings {
141+
font-family: sans-serif;
139142
}
140143

141-
h2 {
142-
@extend %c-heading-2;
144+
h1,
145+
%h1 {
146+
font-size: 18px;
147+
}
148+
149+
h2,
150+
%h2 {
151+
font-size: 16px;
143152
}
144153

145154
// and so on...
@@ -148,14 +157,16 @@ h2 {
148157
// In `/components`
149158
// ---
150159

151-
.c-heading-1,
152-
%c-heading-1 {
153-
font-size: 18px;
160+
.c-heading {
161+
@extend %headings;
154162
}
155163

156-
.c-heading-2,
157-
%c-heading-2 {
158-
font-size: 16px;
164+
.c-heading.c--1 {
165+
@extend %h1;
166+
}
167+
168+
.c-heading.c--2 {
169+
@extend %h2;
159170
}
160171

161172
// and so on...
@@ -175,7 +186,7 @@ What are the consequences of not being able to control parts of the DOM? It mean
175186
}
176187

177188
.BVRRDisplayContentSubtitle {
178-
@extend %c-heading-2;
189+
@extend %h2;
179190
}
180191

181192
.BVRRContextDataContainer > div {

0 commit comments

Comments
 (0)