Skip to content

Commit 992d162

Browse files
authored
Fix: Added slider fill and marking styling (fixes adaptlearning#407) (adaptlearning#408)
1 parent 4f36c11 commit 992d162

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

less/plugins/adapt-contrib-slider/slider.less

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
@slider-handle-width: 2rem;
2+
@slider-handle-height: 2rem;
3+
4+
@slider-track-height: .375rem;
5+
16
.slider {
27
// Numbers
3-
// --------------------------------------------------
48
&__number-container {
59
min-height: 2.5rem;
610
}
@@ -32,10 +36,7 @@
3236
}
3337

3438
// Scale
35-
// --------------------------------------------------
3639
&__scale-container {
37-
margin-top: @item-margin * 2;
38-
margin-bottom: @item-margin * 4;
3940
background-color: lighten(@black, 75%);
4041
}
4142

@@ -44,8 +45,43 @@
4445
}
4546

4647
// Slider bar
47-
// --------------------------------------------------
48-
&__item {
49-
margin-bottom: @item-margin * 4;
48+
&__item-input-track {
49+
background-color: darken(@background-inverted, 20%);
50+
border-radius: 10px;
51+
overflow: hidden;
52+
}
53+
54+
&__item-input-fill {
55+
background-color: @item-color;
56+
}
57+
58+
// Class to show whether the users selection is in/correct
59+
&__widget.show-user-answer.is-correct &__number-selection {
60+
background-color: @validation-success;
61+
color: @validation-success-inverted;
62+
}
63+
64+
&__widget.show-user-answer.is-correct &__item-input-fill {
65+
background-color: @validation-success;
66+
}
67+
68+
&__widget.show-user-answer.is-incorrect &__number-selection {
69+
background-color: @validation-error;
70+
color: @validation-error-inverted;
71+
}
72+
73+
&__widget.show-user-answer.is-incorrect &__item-input-fill {
74+
background-color: @validation-error;
75+
}
76+
77+
&__widget.show-correct-answer.is-correct &__item-input-fill,
78+
&__widget.show-correct-answer.is-incorrect &__item-input-fill {
79+
background-color: @validation-success;
80+
}
81+
82+
&__widget.show-correct-answer.is-correct &__number-model-answer,
83+
&__widget.show-correct-answer.is-incorrect &__number-model-answer {
84+
background-color: @validation-success;
85+
color: @validation-success-inverted;
5086
}
5187
}

0 commit comments

Comments
 (0)