зеркало из
1
0
Форкнуть 0

Fix troubleshooting links color in high contrast modes (#5386)

* Fix troubleshooting links color in high contrast modes

* Change files

* Fix camel case
This commit is contained in:
James Burnside 2024-11-05 11:50:52 -08:00 коммит произвёл GitHub
Родитель 6fb5797419
Коммит 885f76c393
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 44 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Fix troubleshooting links color in high contrast modes",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Fix troubleshooting links color in high contrast modes",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -14,6 +14,7 @@ import {
messageBarIconProps,
messageBarType
} from './utils';
import { messageBarLinkStyles } from './styles/MessageBarLink.styles';
/**
* Strings for {@link _TroubleshootingGuideErrorBar}.
@ -118,9 +119,8 @@ export const _TroubleshootingGuideErrorBar = (props: _TroubleshootingGuideErrorB
onClick={() => {
onPermissionsTroubleshootingClick(permissionsState);
}}
underline
>
<span style={{ color: theme.palette.themeDarkAlt }}>
<span className={messageBarLinkStyles(theme, true)}>
{troubleshootingGuideStrings.devicePermissionLinkText}
</span>
</Link>
@ -133,7 +133,7 @@ export const _TroubleshootingGuideErrorBar = (props: _TroubleshootingGuideErrorB
{strings[error.type]}{' '}
{onNetworkingTroubleshootingClick && (
<Link onClick={onNetworkingTroubleshootingClick} underline>
<span style={{ color: theme.palette.themeDarkAlt }}>
<span className={messageBarLinkStyles(theme, true)}>
{troubleshootingGuideStrings.networkTroubleshootingLinkText}
</span>
</Link>

Просмотреть файл

@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ITheme, mergeStyles } from '@fluentui/react';
/**
* Message Bar incorrectly applies dark theme and high contrast theme styles to links that have no hrefs.
* This is a workaround to ensure that the link color is correct.
*
* More info: https://github.com/microsoft/fluentui/issues/14683
*
* @private
*/
export const messageBarLinkStyles = (theme: ITheme, underline?: boolean): string =>
mergeStyles({
textDecoration: underline ? 'underline' : 'none',
color: theme.palette.themeDarkAlt,
textDecorationColor: theme.palette.themeDarkAlt,
'@media (forced-colors: active)': {
color: 'LinkText',
textDecorationColor: 'LinkText'
}
});