Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/styling",
"comment": "High contrast mode for focus styling.",
"type": "patch"
}
],
"packageName": "@uifabric/styling",
"email": "lynam.emily@gmail.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Button: High contrast mode focus bug fixes.",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "lynam.emily@gmail.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ exports[`CommandBar renders commands correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: 4px;
left: 4px;
outline-color: ButtonText;
right: 4px;
top: 4px;
}
@media screen and (-ms-high-contrast: active){& {
border: none;
}
&:hover {
background-color: #eaeaea;
color: #212121;
Expand Down Expand Up @@ -201,6 +212,17 @@ exports[`CommandBar renders commands correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: 4px;
left: 4px;
outline-color: ButtonText;
right: 4px;
top: 4px;
}
@media screen and (-ms-high-contrast: active){& {
border: none;
}
&:hover {
background-color: #eaeaea;
color: #212121;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ exports[`Breadcrumb renders breadcumb correctly 2`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
color: #004578;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ export const getStyles = memoizeFunction((
const border = semanticColors.buttonBorder;
const disabledBackground = semanticColors.disabledBackground;
const disabledText = semanticColors.disabledText;
const buttonHighContrastFocus = {
left: -2,
top: -2,
bottom: -2,
right: -2,
border: 'none',
outlineColor: 'ButtonText'
};

return {
root: [
getFocusStyle(theme, -1),
getFocusStyle(theme, -1, 'relative', buttonHighContrastFocus),
theme.fonts.medium,
{
boxSizing: 'border-box',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export function standardStyles(theme: ITheme): IButtonStyles {
},

// Split button styles
splitButtonContainer: {},
splitButtonContainer: {
selectors: {
[HighContrastSelector]: {
border: 'none'
}
}
},

splitButtonMenuButton: {
color: theme.palette.white,
Expand Down Expand Up @@ -152,7 +158,13 @@ export function primaryStyles(theme: ITheme): IButtonStyles {
},

// Split button styles
splitButtonContainer: {},
splitButtonContainer: {
selectors: {
[HighContrastSelector]: {
border: 'none'
}
}
},

splitButtonDivider: {
backgroundColor: theme.palette.themeLighter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { IButtonStyles } from '../Button.types';
import {
ITheme,
concatStyleSets
concatStyleSets,
getFocusStyle,
HighContrastSelector,
IRawStyle
} from '../../../Styling';
import { memoizeFunction } from '../../../Utilities';
import {
Expand All @@ -19,13 +22,29 @@ export const getStyles = memoizeFunction((
): IButtonStyles => {
const baseButtonStyles: IButtonStyles = getBaseButtonStyles(theme);
const baseSplitButtonStyles: IButtonStyles = getSplitButtonStyles(theme);
const commandButtonHighContrastFocus = {
left: 4,
top: 4,
bottom: 4,
right: 4,
border: 'none'
};

const commandButtonStyles: IButtonStyles = {
root: {
minWidth: '40px',
backgroundColor: theme.palette.neutralLighter,
color: theme.palette.neutralPrimary,
padding: '0 4px'
},
root: [
getFocusStyle(theme, -1, 'relative', commandButtonHighContrastFocus),
{
minWidth: '40px',
backgroundColor: theme.palette.neutralLighter,
color: theme.palette.neutralPrimary,
padding: '0 4px',
selectors: {
[HighContrastSelector]: {
border: 'none'
}
}
}
],

rootHovered: {
backgroundColor: theme.palette.neutralLight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export const getStyles = memoizeFunction((
theme: ITheme,
customStyles?: IButtonStyles
): IButtonStyles => {
const buttonHighContrastFocus = {
left: -2,
top: -2,
bottom: -2,
right: -2,
border: 'none'
};

const splitButtonStyles: IButtonStyles = {
splitButtonContainer: {
position: 'relative',
Expand All @@ -21,7 +29,7 @@ export const getStyles = memoizeFunction((
border: '1px solid'
},
splitButtonMenuButton: [
getFocusStyle(theme, -1),
getFocusStyle(theme, -1, 'relative', buttonHighContrastFocus),
{
padding: 6,
height: 'auto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ exports[`Button renders ActionButton correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
color: #0078d7;
}
Expand Down Expand Up @@ -153,6 +161,17 @@ exports[`Button renders CommandBarButton correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: 4px;
left: 4px;
outline-color: ButtonText;
right: 4px;
top: 4px;
}
@media screen and (-ms-high-contrast: active){& {
border: none;
}
&:hover {
background-color: #eaeaea;
color: #212121;
Expand Down Expand Up @@ -301,6 +320,14 @@ exports[`Button renders CompoundButton correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
background-color: #eaeaea;
color: #000000;
Expand Down Expand Up @@ -429,6 +456,14 @@ exports[`Button renders DefaultButton correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
background-color: #eaeaea;
color: #000000;
Expand Down Expand Up @@ -527,6 +562,14 @@ exports[`Button renders IconButton correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
color: #004578;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { memoizeFunction } from 'office-ui-fabric-react/lib/Utilities';
import { IButtonStyles } from 'office-ui-fabric-react/lib/Button';
import { HighContrastSelector } from '../../../Styling';

export const getCustomSplitButtonStyles = memoizeFunction((): IButtonStyles => {
return {
splitButtonMenuButton: { backgroundColor: 'white', width: '10px' },
splitButtonMenuIcon: { fontSize: '7px' },
splitButtonDivider: { borderLeft: '1px solid #c8c8c8', right: 12 }
splitButtonDivider: { borderLeft: '1px solid #c8c8c8', right: 12 },
splitButtonContainer: {
selectors: {
[HighContrastSelector]: {
border: 'none'
}
}
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ exports[`ComboBox Renders ComboBox correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
@media screen and (-ms-high-contrast: active){& {
-ms-high-contrast-adjust: none;
background-color: ButtonFace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ exports[`Facepile renders Facepile correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
data="75%"
data-is-focusable={true}
disabled={undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ exports[`Nav renders Nav correctly 1`] = `
top: 1px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
.ms-Nav-compositeLink:hover & {
background-color: #f8f8f8;
color: #333333;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ exports[`Pivot renders Pivot correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
color: #0078d7;
}
Expand Down Expand Up @@ -162,6 +170,14 @@ exports[`Pivot renders Pivot correctly 1`] = `
top: 0px;
z-index: 1;
}
@media screen and (-ms-high-contrast: active){.ms-Fabric.is-focusVisible &:focus:after {
border: none;
bottom: -2px;
left: -2px;
outline-color: ButtonText;
right: -2px;
top: -2px;
}
&:hover {
color: #0078d7;
}
Expand Down
Loading