Skip to content

Commit

Permalink
Message bar zoom (microsoft#28100)
Browse files Browse the repository at this point in the history
* MessageBar: Add SmallScreenSelector styles to use grid layout to properly place buttons

* change file

* snaps
  • Loading branch information
micahgodbolt authored Jun 2, 2023
1 parent 0868df8 commit 4a9f03c
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "MessageBar: Add SmallScreenSelector styles to use grid layout to properly place buttons",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
32 changes: 31 additions & 1 deletion packages/react/src/components/MessageBar/MessageBar.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ export const getStyles = (props: IMessageBarStyleProps): IMessageBarStyles => {
display: 'flex',
width: '100%',
lineHeight: 'normal',
[SmallScreenSelector]: {
display: 'grid',
gridTemplateColumns: 'auto 1fr auto',
gridTemplateRows: '1fr auto',
gridTemplateAreas: `
"icon text close"
"action action action"
`,
},
},
],
iconContainer: [
Expand All @@ -188,6 +197,9 @@ export const getStyles = (props: IMessageBarStyleProps): IMessageBarStyles => {
display: 'flex',
flexShrink: 0,
margin: '8px 0 8px 12px',
[SmallScreenSelector]: {
gridArea: 'icon',
},
},
],
icon: {
Expand All @@ -207,6 +219,9 @@ export const getStyles = (props: IMessageBarStyleProps): IMessageBarStyles => {
flexGrow: 1,
margin: 8,
...fonts.small,
[SmallScreenSelector]: {
gridArea: 'text',
},
selectors: {
[HighContrastSelector]: {
...getHighContrastNoAdjustStyle(),
Expand Down Expand Up @@ -252,7 +267,14 @@ export const getStyles = (props: IMessageBarStyleProps): IMessageBarStyles => {
whiteSpace: 'pre-wrap',
},
],
dismissSingleLine: classNames.dismissSingleLine,
dismissSingleLine: [
classNames.dismissSingleLine,
{
[SmallScreenSelector]: {
gridArea: 'close',
},
},
],
expandSingleLine: classNames.expandSingleLine,
dismissal: [classNames.dismissal, dismissalAndExpandStyle],
expand: [classNames.expand, dismissalAndExpandStyle],
Expand All @@ -269,9 +291,17 @@ export const getStyles = (props: IMessageBarStyleProps): IMessageBarStyles => {
// reset forced colors to browser control for inner actions
forcedColorAdjust: 'auto',
MsHighContrastAdjust: 'auto',
[SmallScreenSelector]: {
gridArea: 'action',
marginRight: 8,
marginBottom: 8,
},
selectors: {
'& button:nth-child(n+2)': {
marginLeft: 8,
[SmallScreenSelector]: {
marginBottom: 0,
},
},
},
},
Expand Down
Loading

0 comments on commit 4a9f03c

Please sign in to comment.