Skip to content

Commit 59be850

Browse files
authored
fix: broken styles after @fluentui/react migration (#466)
* feat: fix broken button styles after @fluentui/react migration * fix: examples buttons * fix: share popup link color
1 parent 752eb84 commit 59be850

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

web/src/components/features/examples/ExamplesSection/ExamplesSection.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
DefaultButton,
1010
type IButtonProps,
1111
type IStackItemProps,
12+
type IButtonStyles,
1213
} from '@fluentui/react'
1314

1415
import type { Snippet } from '~/services/examples'
@@ -75,17 +76,22 @@ export const ExamplesSection: React.FC<Props> = ({ label, snippets, onSelect })
7576
},
7677
}
7778

78-
const btnStyles = {
79+
const btnStyles: IButtonStyles = {
7980
root: {
8081
maxWidth: 'none',
8182
minWidth: 'none',
8283
flex: '1',
8384
padding: `0 ${DefaultSpacing.s1}`,
8485
margin: DefaultSpacing.s1,
8586
borderColor: semanticColors.variantBorder,
87+
justifyContent: 'flex-start',
88+
alignContent: 'center',
8689
},
8790
icon: {
8891
marginRight: DefaultSpacing.s1,
92+
height: '1em',
93+
fontSize: '1em',
94+
lineHeight: '1em',
8995
},
9096
textContainer: {
9197
textAlign: 'left',

web/src/components/modals/AboutModal/FooterButtons/FooterButtons.tsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
import { Stack, DefaultButton, mergeStyleSets } from '@fluentui/react'
3+
import { Stack, DefaultButton, mergeStyleSets, type IButtonStyles } from '@fluentui/react'
44

55
import environment from '~/environment'
66

@@ -13,11 +13,18 @@ const styles = mergeStyleSets({
1313
flexDirection: 'column',
1414
},
1515
},
16-
button: {
17-
display: 'block',
18-
},
1916
})
2017

18+
const btnStyles: IButtonStyles = {
19+
root: {
20+
display: 'flex',
21+
},
22+
icon: {
23+
fontSize: '14px',
24+
height: '14px',
25+
},
26+
}
27+
2128
export const FooterButtons: React.FC = () => (
2229
<Stack
2330
horizontal
@@ -31,7 +38,7 @@ export const FooterButtons: React.FC = () => (
3138
>
3239
<Stack.Item grow={1}>
3340
<DefaultButton
34-
className={styles.button}
41+
styles={btnStyles}
3542
href={environment.urls.issue}
3643
target="_blank"
3744
iconProps={{
@@ -43,7 +50,7 @@ export const FooterButtons: React.FC = () => (
4350
</Stack.Item>
4451
<Stack.Item grow={1}>
4552
<DefaultButton
46-
className={styles.button}
53+
styles={btnStyles}
4754
href={environment.urls.github}
4855
target="_blank"
4956
iconProps={{
@@ -56,7 +63,7 @@ export const FooterButtons: React.FC = () => (
5663

5764
<Stack.Item grow={1}>
5865
<DefaultButton
59-
className={styles.button}
66+
styles={btnStyles}
6067
href={environment.urls.donate}
6168
target="_blank"
6269
iconProps={{

web/src/components/utils/SharePopup.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export const SharePopup: FC<Props> = ({ visible, snippetId, originUrl, onDismiss
4949
styles={{
5050
root: [
5151
{
52-
color: bodyBackground,
52+
// HACK: for some reason in recent @fluentui/react link color is flickering.
53+
color: `${bodyBackground} !important`,
5354
},
5455
],
5556
}}

0 commit comments

Comments
 (0)