Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(menu): pointing && vertical menu redlining #1116

Merged
merged 12 commits into from
Mar 29, 2019

Conversation

jaanus03
Copy link
Contributor

@jaanus03 jaanus03 commented Mar 27, 2019

This PR is a minor update to vertical && pointing menu styles.
It removes bordered corners, straightens the "pointing" indicator and adds focus styles.

Screenshot 2019-03-27 at 16 16 51

@mnajdova
Copy link
Contributor

I am just wondering, do we really have purple left border in hoc theme?

@jaanus03
Copy link
Contributor Author

I am just wondering, do we really have purple left border in hoc theme?

Hey. Good point. Probably not, but let me confirm.

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #1116 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1116      +/-   ##
==========================================
+ Coverage   82.07%   82.09%   +0.01%     
==========================================
  Files         724      724              
  Lines        8663     8661       -2     
  Branches     1236     1234       -2     
==========================================
  Hits         7110     7110              
+ Misses       1536     1534       -2     
  Partials       17       17
Impacted Files Coverage Δ
.../src/themes/teams/components/Menu/menuVariables.ts 66.66% <ø> (ø) ⬆️
...themes/teams-dark/components/Menu/menuVariables.ts 100% <ø> (ø) ⬆️
...src/themes/teams/components/Menu/menuItemStyles.ts 8.19% <0%> (+0.26%) ⬆️
...ms-high-contrast/components/Menu/menuItemStyles.ts 5.55% <0%> (-0.7%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0384c2c...e2e4d3b. Read the comment docs.

@jaanus03
Copy link
Contributor Author

I am just wondering, do we really have purple left border in hoc theme?

You were right. No indicator in the HC theme. Removed it.

@@ -7,6 +7,8 @@ export default (siteVars: any): Partial<MenuVariables> => ({
focusedBorder: `solid ${pxToRem(1)} ${siteVars.colors.white}`,
focusedBackgroundColor: 'transparent',

primaryActiveBorderColor: siteVars.brand06,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would consider renaming this to something without "primary" in it. It might make people think they need the primary prop, which they don't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. Renamed it.

? pointing === 'end'
? { borderRight: `${pxToRem(3)} solid ${v.primaryActiveBorderColor}` }
: { borderLeft: `${pxToRem(3)} solid ${v.primaryActiveBorderColor}` }
? !isFromKeyboard && {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this ternary operator difficult to read. Would it be easier to scan if this were flat, like

...(pointing && vertical && !isFromKeyboard && {
    styles here
}),
...(pointing && !vertical && {
    styles here
}),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -9,6 +9,7 @@ type MenuItemPropsAndState = MenuItemProps & MenuItemState
export const verticalPillsBottomMargin = pxToRem(5)
export const horizontalPillsRightMargin = pxToRem(8)
export const verticalPointingBottomMargin = pxToRem(12)
export const verticalPointingBottomMarginFocus = pxToRem(13)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@codepretty codepretty left a comment

Choose a reason for hiding this comment

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

Read my comments and consider addressing before checking in

@jaanus03 jaanus03 force-pushed the jaanusp/vertical-pointing-menu-redlining branch from 474ee70 to fd23cb3 Compare March 29, 2019 10:52
@jaanus03 jaanus03 force-pushed the jaanusp/vertical-pointing-menu-redlining branch from 5f1482c to 787c4e4 Compare March 29, 2019 11:37
@jaanus03 jaanus03 merged commit b50927b into master Mar 29, 2019
@delete-merged-branch delete-merged-branch bot deleted the jaanusp/vertical-pointing-menu-redlining branch March 29, 2019 12:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants