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(dialogs): themeing support for Teams dark and hc #1297
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b830a23
basic themeing for dialogs
c1cdeab
Merge branch 'master' into fix/dialog-themeing
ae49ec8
add changelog entry
1ed90de
adding border for high contrast theme
de9959d
Merge branch 'master' into fix/dialog-themeing
faefe9a
removing styles that are duplicated from base theme
20fb135
reuse type for base theme
7d840cc
updating changelog
5ea69f9
fixed color variable
814fd50
fixing px to rems
f83fd71
updating border to pixels because we don't want scaling
8bdc1c4
fixing merge conflicts
d447de2
addressing pr feedback
e84efed
Merge branch 'master' into fix/dialog-themeing
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
8 changes: 8 additions & 0 deletions
8
packages/react/src/themes/teams-dark/components/Dialog/dialogVariables.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 { DialogVariables } from '../../../teams/components/Dialog/dialogVariables' | ||
|
|
||
| export default (siteVars: any): Partial<DialogVariables> => { | ||
| return { | ||
| rootBackground: siteVars.colors.grey[650], | ||
| foregroundColor: siteVars.colors.white, | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/react/src/themes/teams-high-contrast/componentStyles.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,4 +1,5 @@ | ||
| export { default as Attachment } from './components/Attachment/attachmentStyles' | ||
| export { default as MenuItem } from './components/Menu/menuItemStyles' | ||
| export { default as Alert } from './components/Alert/alertStyles' | ||
| export { default as Dialog } from './components/Dialog/dialogStyles' | ||
| export { default as Dropdown } from './components/Dropdown/dropdownStyles' |
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
7 changes: 7 additions & 0 deletions
7
packages/react/src/themes/teams-high-contrast/components/Dialog/dialogStyles.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,7 @@ | ||
| import { ICSSInJSStyle } from '../../../types' | ||
|
|
||
| export default { | ||
| root: ({ variables: v }): ICSSInJSStyle => ({ | ||
| border: `1px solid ${v.foregroundColor}`, | ||
| }), | ||
| } | ||
9 changes: 9 additions & 0 deletions
9
packages/react/src/themes/teams-high-contrast/components/Dialog/dialogVariables.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,9 @@ | ||
| import { DialogVariables } from '../../../teams/components/Dialog/dialogVariables' | ||
|
|
||
| export default (siteVars: any): Partial<DialogVariables> => { | ||
| return { | ||
| boxShadow: 'none', | ||
| rootBackground: siteVars.colors.black, | ||
| foregroundColor: siteVars.colors.white, | ||
| } | ||
| } |
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
17 changes: 17 additions & 0 deletions
17
packages/react/src/themes/teams/components/Dialog/dialogStyles.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,17 @@ | ||
| import { DialogProps } from '../../../../components/Dialog/Dialog' | ||
| import { ComponentStyleFunctionParam, ICSSInJSStyle } from '../../../types' | ||
| import { DialogVariables } from './dialogVariables' | ||
|
|
||
| type DialogStyleParams = ComponentStyleFunctionParam<DialogProps, DialogVariables> | ||
|
|
||
| export default { | ||
| root: ({ props: p, variables: v }: DialogStyleParams): ICSSInJSStyle => ({ | ||
codepretty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| boxShadow: v.boxShadow, | ||
| color: v.foregroundColor, | ||
| }), | ||
|
|
||
| header: ({ variables: v }: DialogStyleParams): ICSSInJSStyle => ({ | ||
| fontSize: v.headerFontSize, | ||
| fontWeight: v.headerFontWeight, | ||
| }), | ||
| } | ||
29 changes: 29 additions & 0 deletions
29
packages/react/src/themes/teams/components/Dialog/dialogVariables.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,29 @@ | ||
| import { DialogVariables as BaseDialogVariables } from '../../../base/components/Dialog/dialogVariables' | ||
| import { pxToRem } from '../../../../lib' | ||
|
|
||
| export interface DialogVariables extends BaseDialogVariables { | ||
codepretty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| boxShadow: string | ||
| foregroundColor: string | ||
|
|
||
| headerFontSize: string | ||
| headerFontWeight: number | ||
| } | ||
|
|
||
| export default (siteVariables): DialogVariables => ({ | ||
| boxShadow: siteVariables.shadowLevel4, | ||
| foregroundColor: siteVariables.colors.grey[900], | ||
|
|
||
| rootBackground: siteVariables.colors.white, | ||
| rootBorderRadius: pxToRem(3), | ||
| rootPadding: `${pxToRem(27)} ${pxToRem(32)} ${pxToRem(20)} ${pxToRem(32)}`, | ||
| rootWidth: '50vw', | ||
|
|
||
| contentMargin: `0 0 ${pxToRem(20)} 0`, | ||
|
|
||
| headerFontSize: siteVariables.fontSizes.large, | ||
| headerFontWeight: siteVariables.fontWeightBold, | ||
| headerMargin: `0 0 ${pxToRem(8)} 0`, | ||
|
|
||
| overlayBackground: 'rgba(37, 36, 36, .75)', // todo: update to a palette value when daisy has mapped one | ||
| overlayZIndex: 1000, | ||
| }) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.