forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add height to carousel and use style set
- Loading branch information
Showing
4 changed files
with
67 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,4 @@ | ||
export default function createSuggestedActionsStyle({ | ||
paddingRegular, | ||
transcriptOverlayButtonBackground, | ||
transcriptOverlayButtonBackgroundOnDisabled, | ||
transcriptOverlayButtonBackgroundOnFocus, | ||
transcriptOverlayButtonBackgroundOnHover, | ||
transcriptOverlayButtonColor, | ||
transcriptOverlayButtonColorOnDisabled, | ||
transcriptOverlayButtonColorOnFocus, | ||
transcriptOverlayButtonColorOnHover | ||
}) { | ||
return { | ||
paddingLeft: paddingRegular / 2, | ||
paddingRight: paddingRegular / 2, | ||
|
||
'& button > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackground, | ||
color: transcriptOverlayButtonColor, | ||
outline: 0 | ||
}, | ||
|
||
'& button:disabled > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnDisabled, | ||
color: transcriptOverlayButtonColorOnDisabled | ||
}, | ||
|
||
'& button:focus > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnFocus, | ||
color: transcriptOverlayButtonColorOnFocus | ||
}, | ||
|
||
'& button:hover > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnHover, | ||
color: transcriptOverlayButtonColorOnHover | ||
} | ||
}; | ||
return {}; | ||
} |
61 changes: 57 additions & 4 deletions
61
packages/component/src/Styles/StyleSet/SuggestedActionsStyleSet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,65 @@ | ||
import { css } from 'glamor'; | ||
import { createBasicStyleSet } from 'react-film'; | ||
|
||
export default function createSuggestedActionsStyleSet() { | ||
// This is not CSS, but options to create style set for react-film | ||
return createBasicStyleSet({ | ||
export default function createSuggestedActionsStyleSet({ | ||
transcriptOverlayButtonBackground, | ||
transcriptOverlayButtonBackgroundOnDisabled, | ||
transcriptOverlayButtonBackgroundOnFocus, | ||
transcriptOverlayButtonBackgroundOnHover, | ||
transcriptOverlayButtonColor, | ||
transcriptOverlayButtonColorOnDisabled, | ||
transcriptOverlayButtonColorOnFocus, | ||
transcriptOverlayButtonColorOnHover | ||
}) { | ||
const originalStyleSet = createBasicStyleSet({ | ||
cursor: null, | ||
flipperBoxWidth: 40, | ||
flipperSize: 20, | ||
scrollBarHeight: 6, | ||
scrollBarMargin: 2 | ||
scrollBarMargin: 2, | ||
}); | ||
|
||
const flipper = css({ | ||
'& > div.slider > div': { | ||
background: transcriptOverlayButtonBackground, | ||
color: transcriptOverlayButtonColor, | ||
outline: 0 | ||
}, | ||
|
||
'&:disabled > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnDisabled, | ||
color: transcriptOverlayButtonColorOnDisabled | ||
}, | ||
|
||
'&:focus > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnFocus, | ||
color: transcriptOverlayButtonColorOnFocus | ||
}, | ||
|
||
'&:hover > div.slider > div': { | ||
backgroundColor: transcriptOverlayButtonBackgroundOnHover, | ||
color: transcriptOverlayButtonColorOnHover | ||
} | ||
}); | ||
|
||
const leftFlipper = css(originalStyleSet.leftFlipper, flipper); | ||
const rightFlipper = css(originalStyleSet.rightFlipper, flipper); | ||
const carousel = css(originalStyleSet.carousel, { | ||
'&:hover, &.scrolling': { | ||
[`& .${ leftFlipper + '' } > div.slider, & .${ rightFlipper + '' } > div.slider`]: { | ||
transitionDelay: '0s' | ||
}, | ||
[`& .${ leftFlipper + '' } > div.slider`]: { left: 0 }, | ||
[`& .${ rightFlipper + '' } > div.slider`]: { right: 0 } | ||
} | ||
}); | ||
|
||
// This is not CSS, but options to create style set for react-film | ||
return { | ||
...originalStyleSet, | ||
|
||
carousel, | ||
leftFlipper, | ||
rightFlipper | ||
}; | ||
} |