Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Create scrollableContent element
Browse files Browse the repository at this point in the history
- Auditors: @luixxiul
- Close #8505
- Test Plan: n/a
  • Loading branch information
cezaraugusto committed Apr 26, 2017
1 parent 04319a9 commit 8da5411
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions app/renderer/components/common/scrollableContent.js
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

2 comments on commit 8da5411

@luixxiul
Copy link
Contributor

Choose a reason for hiding this comment

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

++

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

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

wow- nice 😄

Please sign in to comment.