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": "office-ui-fabric-react",
"comment": "Toggle: Updating to use flexbox positioning",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "jdrush89@gmail.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ export const getClassNames = memoizeFunction((
getFocusStyle(theme, -3),
{
fontSize: '20px',
lineHeight: '1em',
boxSizing: 'border-box',
position: 'relative',
width: '2.2em',
height: '1em',
borderRadius: '1em',
Expand All @@ -91,6 +89,9 @@ export const getClassNames = memoizeFunction((
background: pillUncheckedBackground,
borderColor: pillBorderColor,
cursor: 'pointer',
display: 'flex',
alignItems: 'center',
padding: '0 .2em'
},
styles.pill,
!disabled && [
Expand All @@ -108,7 +109,8 @@ export const getClassNames = memoizeFunction((
checked && [
{
background: pillCheckedBackground,
borderColor: 'transparent'
borderColor: 'transparent',
justifyContent: 'flex-end'
},
styles.pillChecked,
{
Expand Down Expand Up @@ -143,7 +145,8 @@ export const getClassNames = memoizeFunction((
checked && [
{
backgroundColor: pillCheckedDisabledBackground,
borderColor: 'transparent'
borderColor: 'transparent',
justifyContent: 'flex-end'
},
styles.pillCheckedDisabled
],
Expand All @@ -156,22 +159,18 @@ export const getClassNames = memoizeFunction((
width: '.5em',
height: '.5em',
borderRadius: '.5em',
position: 'absolute',
top: '.18em',
transition: 'all 0.1s ease',
backgroundColor: thumbBackground,
/* Border is added to handle high contrast mode for Firefox */
borderColor: 'transparent',
borderWidth: '.28em',
borderStyle: 'solid',
boxSizing: 'border-box',
left: '.2em'
boxSizing: 'border-box'
},
styles.thumb,
!disabled && checked && [
{
backgroundColor: thumbCheckedBackground,
left: '1.4em',
selectors: {
[HighContrastSelector]: {
backgroundColor: 'Window',
Expand All @@ -185,14 +184,12 @@ export const getClassNames = memoizeFunction((
!checked && [
{
backgroundColor: thumbDisabledBackground,
left: '.2em',
},
styles.thumbDisabled
],
checked && [
{
backgroundColor: thumbCheckedDisabledBackground,
left: '1.4em'
},
styles.thumbCheckedDisabled
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,22 @@ exports[`Toggle renders toggle correctly 1`] = `
className=
ms-Toggle-background
{
align-items: center;
background: #ffffff;
border-color: #666666;
border-radius: 1em;
border-style: solid;
border-width: 1px;
box-sizing: border-box;
cursor: pointer;
display: flex;
font-size: 20px;
height: 1em;
line-height: 1em;
outline: transparent;
padding-bottom: 0;
padding-left: .2em;
padding-right: .2em;
padding-top: 0;
position: relative;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I'm surprised this didn't get removed

transition: all 0.1s ease;
width: 2.2em;
Expand Down Expand Up @@ -98,9 +103,6 @@ exports[`Toggle renders toggle correctly 1`] = `
border-width: .28em;
box-sizing: border-box;
height: .5em;
left: .2em;
position: absolute;
top: .18em;
transition: all 0.1s ease;
width: .5em;
}
Expand Down