Convert Overlay to mergeStyles#3978
Conversation
| className | ||
| ], | ||
|
|
||
| // Insert className styles |
There was a problem hiding this comment.
I think this comment was meant for above 49?
| } | ||
|
|
||
| export interface IOverlayProps extends React.HTMLAttributes<HTMLElement> { | ||
| export interface IOverlayProps extends React.Props<OverlayBase> { |
There was a problem hiding this comment.
Was there a reason for this change?
There was a problem hiding this comment.
I was experimenting with typings and forgot to change it back, though, this is the pattern other components use. Thanks for catching this.
| IOverlayStyles, | ||
| } from './Overlay.types'; | ||
|
|
||
| import { classNamesFunction } from '../../Utilities'; |
There was a problem hiding this comment.
this import can just move up with the others
|
|
||
| selectors: { | ||
| [HighContrastSelector]: { | ||
| border: '1px solid WindowText', |
There was a problem hiding this comment.
Is WindowText a valid choice here? This may be High Contrast Mode specific, but I just imagine it would be better to use a theme color.
There was a problem hiding this comment.
Yup, it's HighContrast specific.
| @@ -1,41 +1,13 @@ | |||
| import * as React from 'react'; | |||
| import { styled } from '@uifabric/utilities'; | |||
There was a problem hiding this comment.
I think we wanted to do import { styled } from '../../Utilities';
| } | ||
| }, | ||
|
|
||
| isNone && { |
There was a problem hiding this comment.
Process question: From what I can tell this was never actually applied before (just an unused SCSS class), and you went ahead and applied that as an optional prop. Do we want to do this, or assume abandoned functionality was abandoned for a reason. Like in this case does it serve a purpose or is it just a superfluous prop taking up bit space.
There was a problem hiding this comment.
Good question. @battletoilet
| /** | ||
| * Style for the root element. | ||
| */ | ||
| root?: IStyle; |
There was a problem hiding this comment.
don't we want all classNames to be required? @dzearing @mikewheaton
There was a problem hiding this comment.
that way we can insure, inside getStyles, that we're making the entire thing. and then other consumers customizing it can just say Partial if they're merging with the existing one
There was a problem hiding this comment.
In this case, having them required prevents customizing the styles via the customStyles prop.
There was a problem hiding this comment.
Could you point me to an example of Partial styles?
There was a problem hiding this comment.
I would like for us to have a way to insure any and all classNames defined in IFooStyles gets defined in the default implementation, while allowing other implementations to use a Partial<> to only have to override a subset.
I don't have any examples (we barely do any style customization right now as it is). Where is the customStyles prop used, in getStyles? Does this work?
getStyles: IStylesFunction<IFooProps, Partial>
There was a problem hiding this comment.
Excuse me, the Component I was thinking of that uses customStyles is Checkbox, which I have another PR out for. I'll keep Partial in mind.
| const { | ||
| className, | ||
| theme, | ||
| isNone, |
There was a problem hiding this comment.
Could this be renamed for clarity? Maybe reverse it and call it isVisible?
There was a problem hiding this comment.
Agreed, it's not used at the moment so that should be remedied.
There was a problem hiding this comment.
Can we remove it entirely then?
There was a problem hiding this comment.
I had the same question but forgot to follow up on it. @battletoilet - thoughts?
| visibility: 'hidden', | ||
| }, | ||
|
|
||
| isDarkThemed && [ |
There was a problem hiding this comment.
Could we rename this to isDark? That would match the CSS class below, and remove any potential confusion around this prop and theming.
There was a problem hiding this comment.
I'll have to deprecate it but sure.
There was a problem hiding this comment.
Even if we don't change the component's prop, this style prop could be changed for now right?
mikewheaton
left a comment
There was a problem hiding this comment.
Approved with minor comments.
* master: (71 commits) Applying package updates. Delete initials_2018-02-07-13-49.json Delete initials_2018-02-07-13-49.json Delete jolore-addingWorkWeekDateRange_2018-01-24-01-39.json Delete initials_2018-02-07-13-49.json Delete jolore-addingWorkWeekDateRange_2018-01-24-01-39.json Delete initials_2018-02-07-13-49.json Update .npmrc Cleaning Up Console Log in CommandBar Test (microsoft#4011) Convert Overlay to mergeStyles (microsoft#3978) ScrollablePane SCSS to MergeStyles Part 1: File Structure (microsoft#4008) [ContextualMenu] Fixes useTargetWidth property (microsoft#3943) DetailsList: Consider groups when setting aria-rowcount List: Add a _notifyPageChanges function (microsoft#3990) Applying package updates. Migrating Coachmark to main Package, Added a beak component and updated experiment PositioningContainer. (microsoft#3919) Update package.json Added enum for triggering menu with arrow keys and bool to allow it or not (microsoft#3950) BaseExtendedPicker: Hook up onPaste (microsoft#3885) FocusUtil: fix getPreviousElement to include previous sibling elements correctly (microsoft#3928) ...
Pull request checklist
$ npm run changeDescription of changes
Converts Overlay and it's examples to mergeStyles. Add theme support.
Add whiteTranslucent40 to theme palette.
Focus areas to test
Test if Overlay and any component that uses it as a subcomponent still function properly.