-
Notifications
You must be signed in to change notification settings - Fork 2.9k
DatePicker MergeStyles step 2 - Converts scss to js styles #5362
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
Merged
lorejoh12
merged 14 commits into
microsoft:master
from
bennettclark:datepicker-mergestyles-step-2
Jun 29, 2018
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3813de8
datepicker styles conversion progress
bennettclark 4ef49bf
datepicker styles updates
bennettclark ff1cdd1
^finalizes datepicker scss conversion to mergestyles
bennettclark 7867df2
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
bennettclark 4fb2b33
checks over DatePicker styles and updates snapshots
bennettclark efb94d4
changelog
bennettclark ed7ff40
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
bennettclark e923dbd
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
bennettclark c3fe7c4
removes all use of css, creates style concatenation for icon styles, …
bennettclark f3209a5
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
bennettclark 79a4c25
^updates snapshots
bennettclark 1fa4871
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
bennettclark fec4744
fixes test to use datepicker and datepickerbase appropriately
bennettclark f22cb19
removes unused empty object from root styles
bennettclark 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
11 changes: 11 additions & 0 deletions
11
common/changes/office-ui-fabric-react/datepicker-mergestyles-step-2_2018-06-27-22-54.json
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,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "DatePicker MergeStyles step 2 - Converts scss to js styles", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "v-jescla@microsoft.com" | ||
| } |
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
54 changes: 0 additions & 54 deletions
54
packages/office-ui-fabric-react/src/components/DatePicker/DatePicker.scss
This file was deleted.
Oops, something went wrong.
60 changes: 51 additions & 9 deletions
60
packages/office-ui-fabric-react/src/components/DatePicker/DatePicker.styles.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,17 +1,59 @@ | ||
| import { IDatePickerStyleProps, IDatePickerStyles } from './DatePicker.types'; | ||
| import { IStyle, normalize, getGlobalClassNames, FontSizes } from '../../Styling'; | ||
|
|
||
| export const getStyles = (props: IDatePickerStyleProps): IDatePickerStyles => { | ||
| const { className } = props; | ||
| const GlobalClassNames = { | ||
| root: 'ms-DatePicker', | ||
| callout: 'ms-DatePicker-callout', | ||
| withLabel: 'ms-DatePicker-event--with-label', | ||
| withoutLabel: 'ms-DatePicker-event--without-label', | ||
| disabled: 'msDatePickerDisabled ' | ||
| }; | ||
|
|
||
| export const styles = (props: IDatePickerStyleProps): IDatePickerStyles => { | ||
| const { className, theme, disabled, label, isDatePickerShown } = props; | ||
| const { palette } = theme; | ||
| const classNames = getGlobalClassNames(GlobalClassNames, theme); | ||
|
|
||
| const DatePickerEvent: IStyle = { | ||
| color: palette.neutralSecondary, | ||
| fontSize: FontSizes.icon, | ||
| lineHeight: '18px', | ||
| pointerEvents: 'none', | ||
| position: 'absolute', | ||
| right: '9px' | ||
| }; | ||
|
|
||
| return { | ||
| root: [ | ||
| 'ms-DatePicker', | ||
| root: [classNames.root, isDatePickerShown && 'is-open', normalize, className], | ||
| textField: [ | ||
| { | ||
| // Insert css properties | ||
| }, | ||
| className | ||
| position: 'relative', | ||
| selectors: { | ||
| '& input[readonly]': { | ||
| cursor: 'pointer' | ||
| }, | ||
| input: { | ||
| selectors: { | ||
| '::-ms-clear': { | ||
| display: 'none' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| callout: [classNames.callout], | ||
| icon: [ | ||
| DatePickerEvent, | ||
| !label && [classNames.withoutLabel, { top: '7px' }], | ||
| label && [classNames.withLabel, { bottom: '5px' }], | ||
| !disabled && [ | ||
| classNames.disabled, | ||
| { | ||
| pointerEvents: 'initial', | ||
| cursor: 'pointer' | ||
| } | ||
| ] | ||
| ] | ||
|
|
||
| // Insert className styles | ||
| }; | ||
| }; | ||
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
4 changes: 2 additions & 2 deletions
4
packages/office-ui-fabric-react/src/components/DatePicker/DatePicker.tsx
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,14 +1,14 @@ | ||
| import { styled } from '../../Utilities'; | ||
| import { IDatePickerProps, IDatePickerStyleProps, IDatePickerStyles } from './DatePicker.types'; | ||
| import { DatePickerBase } from './DatePicker.base'; | ||
| import { getStyles } from './DatePicker.styles'; | ||
| import { styles } from './DatePicker.styles'; | ||
|
|
||
| /** | ||
| * DatePicker description | ||
| */ | ||
| export const DatePicker = styled<IDatePickerProps, IDatePickerStyleProps, IDatePickerStyles>( | ||
| DatePickerBase, | ||
| getStyles, | ||
| styles, | ||
| undefined, | ||
| { scope: 'DatePicker' } | ||
| ); |
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
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.
👍