Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/four-ghosts-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": minor
---

Center align text content with radio widget's choice indictor.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
.is-correct[aria-pressed="true"] {
background-color: var(--wb-semanticColor-core-background-success-strong);
color: var(--wb-semanticColor-core-foreground-knockout-default);
outline: var(--wb-border-width-medium) solid
var(--wb-semanticColor-core-border-success-default);
outline-offset: var(--wb-sizing-size_020);
width: var(--perseus-multiple-choice-indicator-correct-size);
}

Expand Down
9 changes: 3 additions & 6 deletions packages/perseus/src/widgets/radio/choice.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
--perseus-multiple-choice-divider-space: var(
--wb-border-width-medium
); /* Space between the choices, which is also used to position the divider */
align-items: center; /* Vertically center indicator with content */
border-radius: var(--wb-border-radius-radius_080);
display: flex; /* Enable flexbox layout for indicator and content alignment */
font-size: var(--wb-font-heading-size-medium);
font-weight: var(--wb-font-weight-semi);
line-height: var(--wb-font-heading-lineHeight-medium);
margin-block-end: var(--perseus-multiple-choice-divider-space);
min-height: calc(var(--perseus-multiple-choice-spacing) * 4);
outline: var(--wb-border-width-medium) solid
var(--perseus-multiple-choice-correctness-outline-color, transparent);
outline-offset: calc(var(--wb-border-width-medium) * -1);
padding: var(--perseus-multiple-choice-spacing);
position: relative; /* Needed to enable the dividers (:before and :after pseudo-elements) to position correctly */
width: 100%;
Expand Down Expand Up @@ -138,10 +137,8 @@

.is-correct {
--perseus-multiple-choice-divider-width: 0;
--perseus-multiple-choice-correctness-outline-color: var(
--wb-semanticColor-core-border-success-default
);
color: var(--wb-semanticColor-core-foreground-neutral-strong);
margin-block-end: 3px; /* 3px spacing between correct answers as per design spec */
}

.is-wrong {
Expand Down
Loading