Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

bump office-ui-fabric-react to 5.85.0#300

Merged
chrismohr merged 13 commits intomasterfrom
jsx_for_description
Apr 24, 2018
Merged

bump office-ui-fabric-react to 5.85.0#300
chrismohr merged 13 commits intomasterfrom
jsx_for_description

Conversation

@chrismohr
Copy link
Copy Markdown
Contributor

@chrismohr chrismohr commented Apr 21, 2018

In preparation to allow custom description's on TextField.
microsoft/fluentui#4588

Changes

  1. Avatar - Persona initials changed line-height from 70px to 72px. Added overrided to fix.
    https://github.com/OfficeDev/office-ui-fabric-react/pull/4382/files

  2. MenuButton - Fabric IconButton refactor caused a change in css order. If you look at the commit history, my first fix was to use more specific selectors. Then instead I passed the overrides in through the styles prop on IconButton. I think this will generally be more maintainable, but don't feel great about the hard-coded color strings. Feedback?

  3. Hovercard - .ms-Callout now has a 1px border, when we expected 0. I've added an !important overrride here.

  4. Various snapshot changes.

@chrismohr chrismohr added the wip label Apr 21, 2018
@chrismohr chrismohr changed the title bump office-ui-fabric-react to 5.85.0 [wip] bump office-ui-fabric-react to 5.85.0 Apr 21, 2018
@chrismohr chrismohr force-pushed the jsx_for_description branch from 6f5843c to 791c7b2 Compare April 23, 2018 21:28
@chrismohr chrismohr force-pushed the jsx_for_description branch from c3e602c to 6c35c6a Compare April 23, 2018 23:43
@chrismohr chrismohr changed the title [wip] bump office-ui-fabric-react to 5.85.0 bump office-ui-fabric-react to 5.85.0 Apr 24, 2018
@chrismohr chrismohr removed the wip label Apr 24, 2018
@chrismohr
Copy link
Copy Markdown
Contributor Author

Ok, this is ready for review. @swese44 @unindented @richardtagger

opacity: 0.7,
width: `${this.props.iconSize}px`,
height: `${this.props.iconSize}px`,
color: '#495361',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be time to create a TS file with all these colors, and have it live side-by-side with the CSS one. Having these colors sprinkled in TS code doesn't look great.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree, i don't know what color that is just looking at the PR :(

opacity: 1,
},
};
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will be generating a new object every time this function gets called, which means you'll need to re-render this component every time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like getMenuProps had the same problem, so this isn't making it worse.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the styles can change if certain props change, so i guess we could cache the styles object and update it when props change. seems gross. another option could be to make the entire styles object static, specifying variable values like root width and height on specific root classes and passing the correct root className in at each size?

box-shadow: 0 0 12px rgba(0, 0, 0, 0.2) !important;
border: none;
border-radius: 1px;
border-width: 0px !important;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for units when 0, just border-width: 0 !important.

Copy link
Copy Markdown
Contributor

@swese44 swese44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd like to see us address colors in TS. if you want to ship it now then please add an issue so we can track it.

it would be nice to replace getStyles with a static object, but as @unindented pointed out we still have getMenuProps so it won't help with perf at this point

@chrismohr chrismohr force-pushed the jsx_for_description branch from 965388e to 0e451df Compare April 24, 2018 16:23
lineHeight: '2.8rem',
},
superLarge: fontStyles,
mega: fontStyles,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird thing is that it looks like these fontStyle colors had no effect.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these did override the default typography element colors. are visual diffs still passing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the visual diffs still passed. I manually inspected some elements, but had trouble finding the rule being applied anywhere.

Looking closer now at Block, I see the color is being overridden by a merge style, so instead of #343A41 it is rgb(51, 51, 51).

I'll look a little closer at this, and see if our visual diff picks up the difference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also just to clarify, it's our current version of of yamui (https://microsoft.github.io/YamUI) that is using the wrong color.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that #343A41 is not surfaced anywhere AND that our visual diff would detect the change. If we want #343A41 to be the default text color, it looks like we can add neutralPrimary: blackMetal, to our theme overrides.

@chrismohr chrismohr force-pushed the jsx_for_description branch from 9f0697b to 0e451df Compare April 24, 2018 17:57
button: deathMetal,
buttonHovered: river,
buttonPressed: river,
buttonExpanded: river,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in CSS we abstracted all these colors into pseudo "theme" variables which components would map to their own rules. i think we're getting too specific here, i think we should be mapping our un-understandable blue/stream/pond/deathmetal color names to contextual theme names like Fabric does.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise this colors object will turn into an enormous object with lots of duplication

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swese44 Makes sense. So maybe textColorSecondary and linkColor?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be ideal to just use the same color variables we had in CSS, it'll be easier for us to refactor CSS into mergeStyles in the future

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(or just the subset of the existing color variables you need for button)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. I got the names textColorSecondary and linkColor from the colors.css file, but just converted the name to camel case.

Is this what you had in mind?

const colors = {
  textColorSecondary: deathMetal,
  linkColor: river,
};

Copy link
Copy Markdown
Contributor Author

@chrismohr chrismohr Apr 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the word color is probably a bit redundant. How about this?

const colors = {
  textSecondary: deathMetal,
  link: river,
};

Copy link
Copy Markdown
Contributor

@swese44 swese44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@chrismohr chrismohr merged commit 2137fa7 into master Apr 24, 2018
@chrismohr chrismohr deleted the jsx_for_description branch April 24, 2018 21:34
@chrismohr chrismohr mentioned this pull request Apr 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants