This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04319a9
commit 8da5411
Showing
1 changed file
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const React = require('react') | ||
const ImmutableComponent = require('../immutableComponent') | ||
|
||
const {StyleSheet, css} = require('aphrodite/no-important') | ||
const globalStyles = require('../styles/global') | ||
|
||
class ScrollableContent extends ImmutableComponent { | ||
render () { | ||
return <div data-test-id={this.props.testId} | ||
className={css(styles.wrapper, this.props.scrollClassName)}> | ||
{this.props.children} | ||
</div> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
wrapper: { | ||
boxSizing: 'border-box', | ||
borderRadius: '4px', | ||
paddingRight: globalStyles.spacing.scrollBarSize, | ||
overflowX: 'inherit', | ||
overflowY: 'inherit', | ||
maxHeight: 'inherit', | ||
|
||
'::-webkit-scrollbar': { | ||
width: globalStyles.spacing.scrollBarSize | ||
}, | ||
|
||
'::-webkit-scrollbar-thumb': { | ||
background: globalStyles.color.braveOrange, | ||
boxShadow: globalStyles.shadow.braveComponentsShadow, | ||
borderRadius: '4px' | ||
}, | ||
|
||
'::-webkit-scrollbar-track': { | ||
// specific for this component | ||
boxShadow: 'inset 0px 0px 5px -1px rgba(0, 0, 0, 0.25)', | ||
borderRadius: '4px', | ||
margin: '2px 0' | ||
} | ||
} | ||
}) | ||
|
||
module.exports = ScrollableContent |
8da5411
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
8da5411
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow- nice 😄