Skip to content
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

[web-components] add 'menuitemcheckbox' and 'menuitemradio' styles to fluent-menu-item #17305

Conversation

chrisdholt
Copy link
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

(give an overview)

Focus areas to test

(optional)

@chrisdholt chrisdholt force-pushed the users/chhol/add-menu-item-checkbox-radio-styles branch from 8c7e70d to 3ff2422 Compare March 6, 2021 05:22
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9a3d9da:

Sandbox Source
Fluent UI Button Configuration
codesandbox-react-template Configuration
codesandbox-react-northstar-template Configuration

@size-auditor
Copy link

size-auditor bot commented Mar 6, 2021

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 71010087992167fbc95e4fd1274f8ca5180b7cc8 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Mar 6, 2021

Perf Analysis

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1250 1242 5000
BaseButton mount 1027 971 5000
Breadcrumb mount 45280 46031 5000
ButtonNext mount 1334 1326 5000
Checkbox mount 1624 1619 5000
CheckboxBase mount 1323 1402 5000
ChoiceGroup mount 5167 5148 5000
ComboBox mount 1017 1009 1000
CommandBar mount 10719 10665 1000
ContextualMenu mount 6538 6468 1000
DefaultButton mount 1274 1251 5000
DetailsRow mount 3831 3911 5000
DetailsRowFast mount 3901 3968 5000
DetailsRowNoStyles mount 3668 3659 5000
Dialog mount 1623 1586 1000
DocumentCardTitle mount 1905 1870 1000
Dropdown mount 3552 3521 5000
FocusTrapZone mount 1881 1821 5000
FocusZone mount 1864 1860 5000
IconButton mount 1926 1898 5000
Label mount 364 364 5000
Layer mount 1969 1963 5000
Link mount 515 522 5000
MakeStyles mount 2094 2079 50000
MenuButton mount 1610 1622 5000
MessageBar mount 2148 2127 5000
Nav mount 3501 3504 1000
OverflowSet mount 1103 1114 5000
Panel mount 1531 1458 1000
Persona mount 905 858 1000
Pivot mount 1518 1491 1000
PrimaryButton mount 1416 1408 5000
Rating mount 8102 8177 5000
SearchBox mount 1504 1438 5000
Shimmer mount 2802 2718 5000
Slider mount 2144 2084 5000
SpinButton mount 5402 5461 5000
Spinner mount 432 450 5000
SplitButton mount 3420 3329 5000
Stack mount 558 560 5000
StackWithIntrinsicChildren mount 1668 1627 5000
StackWithTextChildren mount 4990 5048 5000
SwatchColorPicker mount 10801 10892 5000
Tabs mount 1516 1502 1000
TagPicker mount 2951 3002 5000
TeachingBubble mount 12010 12195 5000
Text mount 465 468 5000
TextField mount 1455 1487 5000
ThemeProvider mount 1256 1264 5000
ThemeProvider virtual-rerender 616 619 5000
ThemeProviderNext mount 16110 16165 5000
Toggle mount 876 874 5000
buttonNative mount 123 123 5000

Perf Analysis (Fluent)

Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🦄 Avatar.Fluent 0.2 0.5 0.4:1 2000 396
🦄 Button.Fluent 0.14 0.23 0.61:1 5000 691
🔧 Checkbox.Fluent 0.69 0.38 1.82:1 1000 691
🎯 Dialog.Fluent 0.18 0.24 0.75:1 5000 897
🔧 Dropdown.Fluent 3.23 0.45 7.18:1 1000 3229
🔧 Icon.Fluent 0.15 0.07 2.14:1 5000 744
🦄 Image.Fluent 0.09 0.14 0.64:1 5000 453
🔧 Slider.Fluent 1.64 0.49 3.35:1 1000 1636
🔧 Text.Fluent 0.09 0.04 2.25:1 5000 458
🦄 Tooltip.Fluent 0.12 0.95 0.13:1 5000 623

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
Text.Fluent 458 420 1.09:1
VideoMinimalPerf.default 743 700 1.06:1
Button.Fluent 691 651 1.06:1
GridMinimalPerf.default 429 409 1.05:1
ListNestedPerf.default 692 657 1.05:1
RefMinimalPerf.default 261 249 1.05:1
HeaderSlotsPerf.default 962 926 1.04:1
PortalMinimalPerf.default 181 175 1.03:1
ReactionMinimalPerf.default 497 483 1.03:1
StatusMinimalPerf.default 868 840 1.03:1
IconMinimalPerf.default 799 773 1.03:1
ToolbarMinimalPerf.default 1125 1093 1.03:1
TreeMinimalPerf.default 908 885 1.03:1
AvatarMinimalPerf.default 241 237 1.02:1
ButtonMinimalPerf.default 211 207 1.02:1
ButtonUseCssNestingPerf.default 1200 1181 1.02:1
CardMinimalPerf.default 669 654 1.02:1
ChatWithPopoverPerf.default 497 485 1.02:1
DropdownManyItemsPerf.default 835 815 1.02:1
ListCommonPerf.default 761 747 1.02:1
ListMinimalPerf.default 609 597 1.02:1
LoaderMinimalPerf.default 798 779 1.02:1
MenuButtonMinimalPerf.default 1827 1784 1.02:1
RadioGroupMinimalPerf.default 522 512 1.02:1
SegmentMinimalPerf.default 443 436 1.02:1
TableManyItemsPerf.default 2402 2365 1.02:1
TableMinimalPerf.default 494 483 1.02:1
TooltipMinimalPerf.default 901 881 1.02:1
Avatar.Fluent 396 390 1.02:1
Image.Fluent 453 443 1.02:1
Tooltip.Fluent 623 608 1.02:1
AlertMinimalPerf.default 352 348 1.01:1
AttachmentMinimalPerf.default 190 189 1.01:1
ButtonUseCssPerf.default 928 922 1.01:1
EmbedMinimalPerf.default 4565 4516 1.01:1
ItemLayoutMinimalPerf.default 1416 1408 1.01:1
ListWith60ListItems.default 736 726 1.01:1
MenuMinimalPerf.default 1025 1019 1.01:1
SplitButtonMinimalPerf.default 4179 4152 1.01:1
CustomToolbarPrototype.default 3949 3907 1.01:1
Dialog.Fluent 897 887 1.01:1
AnimationMinimalPerf.default 464 466 1:1
ChatMinimalPerf.default 724 721 1:1
DatepickerMinimalPerf.default 51903 51737 1:1
DropdownMinimalPerf.default 3244 3246 1:1
FlexMinimalPerf.default 360 359 1:1
ImageMinimalPerf.default 465 466 1:1
InputMinimalPerf.default 1380 1381 1:1
LabelMinimalPerf.default 506 504 1:1
SkeletonMinimalPerf.default 451 451 1:1
Dropdown.Fluent 3229 3229 1:1
DividerMinimalPerf.default 438 443 0.99:1
LayoutMinimalPerf.default 487 492 0.99:1
PopupMinimalPerf.default 757 764 0.99:1
ProviderMergeThemesPerf.default 1706 1728 0.99:1
ProviderMinimalPerf.default 999 1011 0.99:1
SliderMinimalPerf.default 1655 1677 0.99:1
TextAreaMinimalPerf.default 583 589 0.99:1
AttachmentSlotsPerf.default 1351 1380 0.98:1
ButtonOverridesMissPerf.default 1794 1829 0.98:1
CarouselMinimalPerf.default 541 550 0.98:1
ChatDuplicateMessagesPerf.default 426 433 0.98:1
Checkbox.Fluent 691 704 0.98:1
Icon.Fluent 744 756 0.98:1
Slider.Fluent 1636 1671 0.98:1
BoxMinimalPerf.default 427 438 0.97:1
CheckboxMinimalPerf.default 3035 3132 0.97:1
DialogMinimalPerf.default 868 898 0.97:1
AccordionMinimalPerf.default 188 196 0.96:1
HeaderMinimalPerf.default 440 459 0.96:1
TextMinimalPerf.default 429 449 0.96:1
RosterPerf.default 1246 1305 0.95:1
TreeWith60ListItems.default 211 221 0.95:1
FormMinimalPerf.default 508 538 0.94:1

:host([aria-checked="true"]) ::slotted([slot="radio-indicator"]) {
display: block;
pointer-events: none;
}
`.withBehaviors(
Copy link
Contributor

@khamudom khamudom Mar 6, 2021

Choose a reason for hiding this comment

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

to fix high contrast on the inputs you can add these rule sets to forcedColorsStylesheetBehavior

            :host .checkbox,
            :host .radio{
                border-color: ${SystemColors.ButtonText};
                background: ${SystemColors.HighlightText};
            }
            :host([checked="true"]) .checkbox,
            :host([checked="true"]) .radio {
                background: ${SystemColors.HighlightText};
                border-color: ${SystemColors.HighlightText};
            }
            :host(:hover) .checkbox,
            :host(:hover) .radio,
            :host(:${focusVisible}) .checkbox,
            :host(:${focusVisible}) .radio,
            :host([checked="true"]:hover) .checkbox,
            :host([checked="true"]:hover) .radio,
            :host([checked="true"]:${focusVisible}) .checkbox,
            :host([checked="true"]:${focusVisible}) .radio {
                border-color: ${SystemColors.HighlightText};
            }
            :host([aria-checked="true"]) {
                background: ${SystemColors.Highlight};
                color: ${SystemColors.HighlightText};
            }
            :host([aria-checked="true"]) .checkbox-indicator,
            :host([aria-checked="true"]) ::slotted([slot="checkbox-indicator"]),
            :host([aria-checked="true"]) ::slotted([slot="radio-indicator"]) {
                fill: ${SystemColors.Highlight};
            }
            :host([aria-checked="true"]) .radio-indicator {
                background: ${SystemColors.Highlight};
            }
            :host([checked="true"]) .start,
            :host([checked="true"]) .end {
                fill: ${SystemColors.HighlightText};
            }

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @khamudom - updated!

@chrisdholt chrisdholt merged commit a8552af into microsoft:master Mar 6, 2021
@chrisdholt chrisdholt deleted the users/chhol/add-menu-item-checkbox-radio-styles branch March 6, 2021 20:04
@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/web-components@v0.15.0 has been released which incorporates this pull request.:tada:

Handy links:

joshualamusga1 pushed a commit to joshualamusga1/fluentui that referenced this pull request Mar 25, 2021
… fluent-menu-item (microsoft#17305)

* add menuitemcheckbox and menuitemradio styling to menu-item

* Change files

* add high contrast styles
miroslavstastny pushed a commit to miroslavstastny/fluentui that referenced this pull request May 5, 2021
… fluent-menu-item (microsoft#17305)

* add menuitemcheckbox and menuitemradio styling to menu-item

* Change files

* add high contrast styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants