-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(radio)!: remove top level subcomponents #1690
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,88 @@ | |
display: flex; | ||
gap: var(--eds-size-1); | ||
} | ||
|
||
/** | ||
* Wraps the visually hidden radio input element and the visible sibling svg element. | ||
*/ | ||
.input__wrapper { | ||
position: relative; | ||
/* Centers the radio icon in the wrapper. */ | ||
display: inline-flex; | ||
align-items: center; | ||
/* Aligns the radio with the first line of the label. */ | ||
align-self: flex-start; | ||
} | ||
/** | ||
* The visually hidden input element for the radio. The visual radio is provided by an svg element. | ||
*/ | ||
.radio__input { | ||
/* Removes default margins placed by browser for radioes. */ | ||
margin: 0; | ||
/* Remove the radio from the page flow, positioning it on top of the SVG. */ | ||
position: absolute; | ||
left: 0.25rem; | ||
/* Set same dimensions as the RadioSvg element. */ | ||
height: var(--eds-size-2); | ||
width: var(--eds-size-2); | ||
/** | ||
* Hide the input element visually. | ||
* This ensures the radio is still "physically" present so that all users, | ||
* especially on touch screen readers, still interact with the real radio element | ||
* where it would naturally be present. | ||
*/ | ||
opacity: 0; | ||
} | ||
|
||
/** | ||
* The visible radio svg icon element. | ||
*/ | ||
.radio__icon { | ||
color: var(--eds-theme-color-radio-brand-background); | ||
/* Creates space for the border so that there's no jitter when the focus border is visible. */ | ||
border: var(--eds-border-width-sm) solid transparent; | ||
} | ||
.radio__input:focus-visible + .radio__icon { | ||
border: var(--eds-border-width-sm) solid var(--eds-theme-color-focus-ring); | ||
border-radius: var(--eds-border-radius-full); | ||
} | ||
|
||
@supports not selector(:focus-visible) { | ||
.radio__input:focus + .radio__icon { | ||
border: var(--eds-border-width-sm) solid var(--eds-theme-color-focus-ring); | ||
border-radius: var(--eds-border-radius-full); | ||
} | ||
} | ||
|
||
/** | ||
* The disabled variant of the visible radio svg icon. | ||
*/ | ||
.radio__icon--disabled { | ||
color: var(--eds-theme-color-icon-disabled); | ||
} | ||
|
||
/** | ||
* The disabled status of the visually hidden input element. | ||
*/ | ||
.radio__input:disabled { | ||
/* Needed since the input element overlays the visible svg icon for user input and cursor. */ | ||
cursor: not-allowed; | ||
} | ||
|
||
/** | ||
* Text that labels a radio input. | ||
*/ | ||
.radio__label { | ||
position: relative; | ||
} | ||
|
||
/** | ||
* Radio label size variants. | ||
* Used for centering the label with the radio input button. | ||
*/ | ||
.radio__label--md { | ||
top: 0.125rem; | ||
} | ||
.radio__label--lg { | ||
top: 0.0625rem; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a fan of this, but again this was just brought over :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0.125rem corresponds to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll convert the instances of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very small... one pixel in fact :/ This seems to exist to vertically center the text with the radio button. there may be a way to do the same via flex and avoid this kinda thing altogether. So as not to over-complicate this PR, we can make a comment on why such a precise value is being used, then leave it be for now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense to me, will do |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be
--eds-size-half
i think but I'm guessing this was just brought over from the other file