0
0
SASSmarkup~10 mins

Chained extensions in SASS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to extend the .button style in .primary-button.

SASS
.primary-button {
  @extend [1];
  background-color: blue;
}
Drag options to blanks, or click blank then click option'
A.btn
B.primary
C.button
D.link
Attempts:
3 left
💡 Hint
Common Mistakes
Using a class name that does not exist like .primary or .btn
Forgetting the dot before the class name
Using @include instead of @extend
2fill in blank
medium

Complete the code to chain extensions so .alert-button inherits from .button and .alert.

SASS
.alert-button {
  @extend [1];
  @extend .alert;
  color: red;
}
Drag options to blanks, or click blank then click option'
A.button
B.alert-button
C.alert
D.primary-button
Attempts:
3 left
💡 Hint
Common Mistakes
Extending .alert twice
Extending .alert-button inside itself
Using @include instead of @extend
3fill in blank
hard

Fix the error in the chained extension by completing the missing class to extend.

SASS
.success-button {
  @extend [1];
  @extend .button;
  background-color: green;
}
Drag options to blanks, or click blank then click option'
A.alert
B.primary
C.button
D.success
Attempts:
3 left
💡 Hint
Common Mistakes
Extending .alert instead of .success
Extending .button twice
Forgetting the dot before the class name
4fill in blank
hard

Fill both blanks to chain extensions so .warning-button inherits from .button and .warning.

SASS
.warning-button {
  @extend [1];
  @extend [2];
  border: 1px solid orange;
}
Drag options to blanks, or click blank then click option'
A.button
B.alert
C.warning
D.primary
Attempts:
3 left
💡 Hint
Common Mistakes
Extending .alert instead of .warning
Extending .primary instead of .button
Using the same class twice
5fill in blank
hard

Fill all three blanks to chain extensions so .custom-button inherits from .button, .alert, and .custom.

SASS
.custom-button {
  @extend [1];
  @extend [2];
  @extend [3];
  font-weight: bold;
}
Drag options to blanks, or click blank then click option'
A.button
B.alert
C.custom
D.primary
Attempts:
3 left
💡 Hint
Common Mistakes
Extending .primary instead of .custom
Repeating the same class twice
Forgetting the dot before class names