Skip to content

Commit

Permalink
fix: broken styles after @fluentui/react migration (#466)
Browse files Browse the repository at this point in the history
* feat: fix broken button styles after @fluentui/react migration

* fix: examples buttons

* fix: share popup link color
  • Loading branch information
x1unix authored Jan 25, 2025
1 parent 752eb84 commit 59be850
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DefaultButton,
type IButtonProps,
type IStackItemProps,
type IButtonStyles,
} from '@fluentui/react'

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

const btnStyles = {
const btnStyles: IButtonStyles = {
root: {
maxWidth: 'none',
minWidth: 'none',
flex: '1',
padding: `0 ${DefaultSpacing.s1}`,
margin: DefaultSpacing.s1,
borderColor: semanticColors.variantBorder,
justifyContent: 'flex-start',
alignContent: 'center',
},
icon: {
marginRight: DefaultSpacing.s1,
height: '1em',
fontSize: '1em',
lineHeight: '1em',
},
textContainer: {
textAlign: 'left',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { Stack, DefaultButton, mergeStyleSets } from '@fluentui/react'
import { Stack, DefaultButton, mergeStyleSets, type IButtonStyles } from '@fluentui/react'

import environment from '~/environment'

Expand All @@ -13,11 +13,18 @@ const styles = mergeStyleSets({
flexDirection: 'column',
},
},
button: {
display: 'block',
},
})

const btnStyles: IButtonStyles = {
root: {
display: 'flex',
},
icon: {
fontSize: '14px',
height: '14px',
},
}

export const FooterButtons: React.FC = () => (
<Stack
horizontal
Expand All @@ -31,7 +38,7 @@ export const FooterButtons: React.FC = () => (
>
<Stack.Item grow={1}>
<DefaultButton
className={styles.button}
styles={btnStyles}
href={environment.urls.issue}
target="_blank"
iconProps={{
Expand All @@ -43,7 +50,7 @@ export const FooterButtons: React.FC = () => (
</Stack.Item>
<Stack.Item grow={1}>
<DefaultButton
className={styles.button}
styles={btnStyles}
href={environment.urls.github}
target="_blank"
iconProps={{
Expand All @@ -56,7 +63,7 @@ export const FooterButtons: React.FC = () => (

<Stack.Item grow={1}>
<DefaultButton
className={styles.button}
styles={btnStyles}
href={environment.urls.donate}
target="_blank"
iconProps={{
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/utils/SharePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const SharePopup: FC<Props> = ({ visible, snippetId, originUrl, onDismiss
styles={{
root: [
{
color: bodyBackground,
// HACK: for some reason in recent @fluentui/react link color is flickering.
color: `${bodyBackground} !important`,
},
],
}}
Expand Down

0 comments on commit 59be850

Please sign in to comment.