-
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(checkbox)!: remove top level subcomponents #1693
Merged
jinlee93
merged 1 commit into
feature/EFI-1219
from
jlee/mergeTogetherCheckboxComponents
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,76 @@ | ||
@import '../../design-tokens/mixins.css'; | ||
|
||
.checkbox { | ||
display: flex; | ||
gap: var(--eds-size-1); | ||
} | ||
|
||
.checkbox__input { | ||
height: 18px; | ||
width: 18px; | ||
|
||
/* The parent Checkbox component is a flex container. Make sure the input doesn't shrink. */ | ||
flex-shrink: 0; | ||
|
||
/* Remove the browser's checkbox styles, allowing us to provide our own. */ | ||
appearance: none; | ||
|
||
/* Magic value to center the checkbox on its label. */ | ||
margin: 3px; | ||
|
||
color: var(--eds-theme-color-checkbox-brand-background); | ||
border: 2px solid currentColor; | ||
|
||
/* Place the ::before content smack in the middle of the input. */ | ||
display: grid; | ||
place-content: center; | ||
} | ||
|
||
.checkbox__input:checked::before { | ||
background-color: currentColor; | ||
content: ''; | ||
|
||
/* Clip this element in the shape of a checkbox. The element's background color will be visible | ||
anywhere the svg path is solid. Whatever is behind the checkbox will show through wherever the | ||
svg is transparent. See https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path */ | ||
clip-path: path( | ||
'M10.6 16.2L17.65 9.15L16.25 7.75L10.6 13.4L7.75 10.55L6.35 11.95L10.6 16.2ZM3 21V3H21V21H3Z' | ||
); | ||
|
||
/* Because the path does not have an explicit viewbox, this element's bounding box establishes | ||
one. In other words, the height/width here need to match the expected viewbox for the path. */ | ||
height: 24px; | ||
width: 24px; | ||
} | ||
|
||
.checkbox__input:indeterminate::before { | ||
background-color: currentColor; | ||
content: ''; | ||
|
||
clip-path: path('M7 13H17V11H7V13ZM3 21V3H21V21H3Z'); | ||
|
||
height: 24px; | ||
width: 24px; | ||
} | ||
|
||
.checkbox__input:focus-visible { | ||
@mixin focus; | ||
} | ||
|
||
@supports not selector(:focus-visible) { | ||
.checkbox__input:focus { | ||
@mixin focus; | ||
outline-offset: 1px; | ||
} | ||
} | ||
|
||
.checkbox__input:disabled { | ||
color: var(--eds-theme-color-icon-disabled); | ||
cursor: not-allowed; | ||
} | ||
|
||
.checkbox__label--md { | ||
/* Center the first line of the medium label with the checkbox. */ | ||
position: relative; | ||
top: 0.0625rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export { Checkbox as default } from './Checkbox'; | ||
export type { CheckboxProps } from './Checkbox'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
here's that 1/8 thing again. I imagine radio and checkbox need and use it for the same exact reason