This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
fix(Checkbox): refined styles to match redline and add dark and contrast theme #1656
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
203794c
main changes for checkbox styling update
bcalvery fdd6f66
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery 47ab60c
cleaning up variable names and camelCasing
bcalvery 7c50655
removing comment
bcalvery 6092d98
adding PR to changelog
bcalvery 4c6bd86
fix checkbox icon size
bcalvery d96adb7
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery df01d0d
tweak padding for focus border
bcalvery cf6e83a
removing empty file and refining changelog entry
bcalvery e0f279a
implementing PR feedback
bcalvery 06199ee
simplifying checkbox style logic
bcalvery 6d3f85a
Updates to toggle indicator per Daisy
bcalvery a264b04
Merge from master
bcalvery fbf62d9
reducing variable names and removing extra code
bcalvery 9b2e79a
removing items redundant to base theme
bcalvery 069a6fa
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery 983c88b
merge from master and fix conflicts.
bcalvery e19f0e9
merge from master
bcalvery 30318f9
modify mergeSiteVariables in mergeThemes
bcalvery 387c9ad
revert change to mergeThemes.
bcalvery 0fb8e79
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery c528dd0
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery d79d048
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery fe9efed
Merge branch 'master' into fix/checkbox-themeing
bcalvery 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
80 changes: 38 additions & 42 deletions
80
packages/react/src/themes/base/components/Checkbox/checkboxVariables.ts
This file contains hidden or 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,79 +1,75 @@ | ||
| import { pxToRem } from '../../../../lib' | ||
|
|
||
| export type CheckboxVariables = { | ||
| checkboxBackground: string | ||
| checkboxBorderColor: string | ||
| checkboxBorderStyle: string | ||
| checkboxBorderRadius: string | ||
| checkboxBorderWidth: string | ||
| background: string | ||
| borderColor: string | ||
| borderStyle: string | ||
| borderRadius: string | ||
| borderWidth: string | ||
| checkboxColor: string | ||
| checkboxGap: string | ||
| checkboxMargin: string | ||
| checkboxPadding: string | ||
| gap: string | ||
| margin: string | ||
| padding: string | ||
|
|
||
| toggleBackground: string | ||
| toggleBorderColor: string | ||
| toggleBorderStyle: string | ||
| toggleBorderRadius: string | ||
| toggleBorderWidth: string | ||
| toggleColor: string | ||
| toggleIndicatorColor: string | ||
| toggleMargin: string | ||
| togglePadding: string | ||
|
|
||
| checkedCheckboxBackground: string | ||
| checkedCheckboxBorderColor: string | ||
| checkedCheckboxColor: string | ||
| checkedToggleColor: string | ||
| checkedToggleBackground: string | ||
| checkedToggleBorderColor: string | ||
| checkedTogglePadding: string | ||
| checkedBackground: string | ||
| checkedBorderColor: string | ||
| checkboxCheckedColor: string | ||
| checkboxToggleCheckedColor: string | ||
| checkboxToggleCheckedBackground: string | ||
| checkboxToggleCheckedBorderColor: string | ||
| toggleCheckedPadding: string | ||
|
|
||
| disabledColor: string | ||
| disabledCheckboxBackground: string | ||
| disabledCheckboxBorderColor: string | ||
| disabledBackground: string | ||
| disabledBorderColor: string | ||
| disabledCheckboxColor: string | ||
| disabledToggleColor: string | ||
| disabledToggleIndicatorColor: string | ||
| disabledToggleBackground: string | ||
| disabledToggleBorderColor: string | ||
|
|
||
| padding: string | ||
| } | ||
|
|
||
| export default (siteVars: any): CheckboxVariables => ({ | ||
| checkboxBackground: 'transparent', | ||
| checkboxBorderColor: siteVars.colors.grey[300], | ||
| checkboxBorderStyle: `solid`, | ||
| checkboxBorderRadius: pxToRem(4), | ||
| checkboxBorderWidth: pxToRem(1), | ||
| background: 'transparent', | ||
| borderColor: siteVars.colors.grey[300], | ||
| borderStyle: `solid`, | ||
| borderRadius: pxToRem(4), | ||
| borderWidth: pxToRem(1), | ||
| checkboxColor: 'transparent', | ||
| checkboxGap: pxToRem(12), | ||
| checkboxMargin: '0', | ||
| checkboxPadding: '0', | ||
| gap: pxToRem(12), | ||
| margin: '0', | ||
| padding: '0', | ||
|
|
||
| toggleBackground: 'transparent', | ||
| toggleBorderColor: siteVars.colors.grey[300], | ||
| toggleBorderStyle: `solid`, | ||
| toggleBorderRadius: pxToRem(999), | ||
| toggleBorderWidth: pxToRem(1), | ||
| toggleColor: 'inherit', | ||
| toggleIndicatorColor: 'inherit', | ||
| toggleMargin: '0', | ||
| togglePadding: `0 ${pxToRem(20)} 0 0`, | ||
|
|
||
| checkedCheckboxBackground: 'transparent', | ||
| checkedCheckboxBorderColor: siteVars.colors.grey[500], | ||
| checkedCheckboxColor: siteVars.colors.grey[500], | ||
| checkedToggleBackground: 'transparent', | ||
| checkedToggleBorderColor: siteVars.colors.grey[500], | ||
| checkedToggleColor: 'inherit', | ||
| checkedTogglePadding: `0 0 0 ${pxToRem(20)}`, | ||
| checkedBackground: 'transparent', | ||
| checkedBorderColor: siteVars.colors.grey[500], | ||
| checkboxCheckedColor: siteVars.colors.grey[500], | ||
| checkboxToggleCheckedBackground: 'transparent', | ||
| checkboxToggleCheckedBorderColor: siteVars.colors.grey[500], | ||
| checkboxToggleCheckedColor: 'inherit', | ||
| toggleCheckedPadding: `0 0 0 ${pxToRem(20)}`, | ||
|
|
||
| disabledColor: siteVars.colors.grey[300], | ||
| disabledCheckboxBackground: siteVars.colors.grey[200], | ||
| disabledCheckboxBorderColor: siteVars.colors.grey[100], | ||
| disabledBackground: siteVars.colors.grey[200], | ||
| disabledBorderColor: siteVars.colors.grey[100], | ||
| disabledCheckboxColor: siteVars.colors.grey[300], | ||
| disabledToggleBackground: 'transparent', | ||
| disabledToggleBorderColor: siteVars.colors.grey[200], | ||
| disabledToggleColor: siteVars.colors.grey[300], | ||
|
|
||
| padding: `0 ${pxToRem(4)}`, | ||
| disabledToggleIndicatorColor: siteVars.colors.grey[300], | ||
| }) | ||
This file contains hidden or 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
8 changes: 8 additions & 0 deletions
8
packages/react/src/themes/teams-high-contrast/components/Checkbox/checkboxVariables.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { CheckboxVariables } from '../../../teams/components/Checkbox/checkboxVariables' | ||
|
|
||
| export default (siteVars: any): Partial<CheckboxVariables> => { | ||
| return { | ||
| borderColorHover: siteVars.accessibleYellow, | ||
| disabledToggleIndicatorColor: siteVars.accessibleGreen, | ||
| } | ||
| } |
100 changes: 99 additions & 1 deletion
100
packages/react/src/themes/teams/components/Checkbox/checkboxStyles.ts
This file contains hidden or 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
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.
I think that
checkedToggleColor,checkedToggleBackgroundandcheckedToggleBorderColornamings were fine.