Skip to content

Commit

Permalink
Less tidy up (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
guywillis authored Sep 4, 2020
1 parent e092b19 commit 1f65a5b
Showing 1 changed file with 16 additions and 38 deletions.
54 changes: 16 additions & 38 deletions less/mcq.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
display: none;
}

// --------------------------------------------------
// MCQ item icons
// --------------------------------------------------
&__item-answer-icon.is-radio .icon {
Expand All @@ -36,16 +35,12 @@
.icon-checkbox-unchecked;
}

&__item-label.is-selected {
.mcq__item-answer-icon.is-radio .icon {
.icon-radio-checked;
}
&__item-label.is-selected &__item-answer-icon.is-radio .icon {
.icon-radio-checked;
}

&__item-label.is-selected {
.mcq__item-answer-icon.is-checkbox .icon {
.icon-checkbox-checked;
}
&__item-label.is-selected &__item-answer-icon.is-checkbox .icon {
.icon-checkbox-checked;
}

&__item-correct-icon .icon {
Expand All @@ -55,49 +50,32 @@
&__item-incorrect-icon .icon {
.icon-cross;
}
// --------------------------------------------------

// --------------------------------------------------
// Class to show the selection icons until the component is complete
// --------------------------------------------------
&__widget:not(.is-complete) {
.mcq__item-answer-icon {
display: block;
}
&__widget:not(.is-complete) &__item-answer-icon {
display: block;
}
// --------------------------------------------------

// --------------------------------------------------
// Class to show the users selection
// --------------------------------------------------
&__widget.show-user-answer {
.is-correct .is-selected .mcq__item-correct-icon,
.is-incorrect .is-selected .mcq__item-incorrect-icon {
display: block;
}
&__widget.show-user-answer .is-correct .is-selected &__item-correct-icon,
&__widget.show-user-answer .is-incorrect .is-selected &__item-incorrect-icon {
display: block;
}

&__widget.show-user-answer {
.mcq__item:not(.is-correct):not(.is-incorrect) .is-selected .mcq__item-answer-icon {
display: block;
}
&__widget.show-user-answer &__item:not(.is-correct):not(.is-incorrect) .is-selected &__item-answer-icon {
display: block;
}
// --------------------------------------------------

// --------------------------------------------------
// Class to show the correct answers
// --------------------------------------------------
&__widget.show-correct-answer {
.is-correct .is-selected .mcq__item-correct-icon,
.is-incorrect .is-selected .mcq__item-correct-icon {
display: block;
}
&__widget.show-correct-answer .is-correct .is-selected &__item-correct-icon,
&__widget.show-correct-answer .is-incorrect .is-selected &__item-correct-icon {
display: block;
}

&__widget.show-correct-answer {
.mcq__item:not(.is-correct):not(.is-incorrect) .is-selected .mcq__item-answer-icon {
display: block;
}
&__widget.show-correct-answer &__item:not(.is-correct):not(.is-incorrect) .is-selected &__item-answer-icon {
display: block;
}
// --------------------------------------------------
}

0 comments on commit 1f65a5b

Please sign in to comment.