|
| 1 | +.quiz { |
| 2 | + display: flex; |
| 3 | + flex-direction: column; |
| 4 | + |
| 5 | + background-color: var(--site-raised-bgColor-translucent); |
| 6 | + border-radius: var(--site-radius); |
| 7 | + padding: 1rem; |
| 8 | + |
| 9 | + .quiz-title { |
| 10 | + margin: 0; |
| 11 | + font-size: 1.5rem; |
| 12 | + font-weight: 500; |
| 13 | + color: var(--site-base-fgColor-lighter); |
| 14 | + } |
| 15 | + |
| 16 | + .quiz-progress { |
| 17 | + font-size: 0.9rem; |
| 18 | + color: var(--site-primary-color); |
| 19 | + font-weight: 500; |
| 20 | + } |
| 21 | + |
| 22 | + .quiz-question { |
| 23 | + margin-top: 1.5rem; |
| 24 | + display: none; |
| 25 | + |
| 26 | + &.active { |
| 27 | + display: block; |
| 28 | + } |
| 29 | + |
| 30 | + ol { |
| 31 | + padding: 0; |
| 32 | + margin: 0; |
| 33 | + margin-top: 1rem; |
| 34 | + list-style: upper-alpha; |
| 35 | + list-style-position: inside; |
| 36 | + |
| 37 | + li { |
| 38 | + padding: 1rem; |
| 39 | + background-color: var(--site-raised-bgColor); |
| 40 | + border-radius: var(--site-radius); |
| 41 | + margin-bottom: 0.2rem; |
| 42 | + transition: background-color 500ms; |
| 43 | + |
| 44 | + &:not(:where([aria-pressed="true"], [aria-disabled="true"])):hover { |
| 45 | + background-color: var(--site-inset-bgColor); |
| 46 | + cursor: pointer; |
| 47 | + } |
| 48 | + |
| 49 | + &[aria-pressed="true"]:has(.correct) { |
| 50 | + background-color: oklch(from var(--site-alert-tip-color) l c h / 0.2); |
| 51 | + } |
| 52 | + |
| 53 | + &[aria-pressed="true"]:has(.incorrect) { |
| 54 | + background-color: oklch(from var(--site-alert-error-color) l c h / 0.2); |
| 55 | + } |
| 56 | + |
| 57 | + &:not([aria-pressed="true"])[aria-disabled="true"] { |
| 58 | + opacity: 0.6; |
| 59 | + } |
| 60 | + |
| 61 | + p { |
| 62 | + margin-bottom: 0; |
| 63 | + } |
| 64 | + |
| 65 | + .question-wrapper { |
| 66 | + display: grid; |
| 67 | + grid-template-rows: min-content 0fr; |
| 68 | + transition: grid-template-rows 500ms; |
| 69 | + } |
| 70 | + |
| 71 | + &[aria-pressed="true"] .question-wrapper { |
| 72 | + grid-template-rows: min-content 1fr; |
| 73 | + } |
| 74 | + |
| 75 | + .question { |
| 76 | + margin-top: -1lh; |
| 77 | + margin-left: 1.4rem; |
| 78 | + } |
| 79 | + |
| 80 | + .solution { |
| 81 | + position: relative; |
| 82 | + padding-left: 1.4rem; |
| 83 | + font-size: 0.9rem; |
| 84 | + overflow: hidden; |
| 85 | + |
| 86 | + p.correct, |
| 87 | + p.incorrect { |
| 88 | + padding-top: 0.5rem; |
| 89 | + font-weight: 600; |
| 90 | + margin-bottom: 0.5rem; |
| 91 | + |
| 92 | + &::before { |
| 93 | + position: absolute; |
| 94 | + left: 0; |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + p.correct { |
| 99 | + color: green; |
| 100 | + |
| 101 | + &::before { |
| 102 | + content: "✓"; |
| 103 | + } |
| 104 | + } |
| 105 | + |
| 106 | + p.incorrect { |
| 107 | + color: red; |
| 108 | + |
| 109 | + &::before { |
| 110 | + content: "✗"; |
| 111 | + } |
| 112 | + } |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | + } |
| 118 | + |
| 119 | + .quiz-complete { |
| 120 | + min-height: 15rem; |
| 121 | + display: flex; |
| 122 | + flex-direction: column; |
| 123 | + justify-content: center; |
| 124 | + align-items: center; |
| 125 | + |
| 126 | + strong { |
| 127 | + font-size: 2rem; |
| 128 | + } |
| 129 | + } |
| 130 | + |
| 131 | + .quiz-actions { |
| 132 | + display: flex; |
| 133 | + justify-content: space-between; |
| 134 | + margin-top: 1rem; |
| 135 | + |
| 136 | + .quiz-button { |
| 137 | + &.secondary { |
| 138 | + background-color: var(--site-inset-bgColor); |
| 139 | + color: var(--site-base-fgColor); |
| 140 | + } |
| 141 | + |
| 142 | + &[disabled] { |
| 143 | + opacity: 0.4; |
| 144 | + pointer-events: none; |
| 145 | + } |
| 146 | + } |
| 147 | + } |
| 148 | +} |
0 commit comments