diff --git a/app/app.global.css b/app/app.global.css index a042a23..106e353 100644 --- a/app/app.global.css +++ b/app/app.global.css @@ -24,7 +24,3 @@ table { table td { word-wrap: break-word; } - -::-webkit-scrollbar { - display: none; -} diff --git a/app/components/Container.js b/app/components/Container.js index 0ddec45..e248575 100644 --- a/app/components/Container.js +++ b/app/components/Container.js @@ -8,4 +8,8 @@ export default styled.div` padding: 40px; flex-wrap: wrap; overflow: scroll; + + &::-webkit-scrollbar { + display: none; + } `; diff --git a/app/components/ScrollerBase.js b/app/components/ScrollerBase.js new file mode 100644 index 0000000..ee16f80 --- /dev/null +++ b/app/components/ScrollerBase.js @@ -0,0 +1,20 @@ +import styled from 'styled-components'; + +export const ScrollerBase = styled.div` + overflow: scroll; + + &::-webkit-scrollbar-corner { + background: transparent; + } + + &::-webkit-scrollbar { + width: 6px; + height: 6px; + background: transparent; + } + + &::-webkit-scrollbar-thumb { + background: hsla(0, 0%, 100%, 0.25); + border-radius: 3px; + } +`; diff --git a/app/containers/Assets.js b/app/containers/Assets.js index f9d586c..f5495ef 100644 --- a/app/containers/Assets.js +++ b/app/containers/Assets.js @@ -6,15 +6,15 @@ import { fadeIn } from 'react-animations'; import Text from '../components/Text'; import Error from '../components/Error'; import Loading from '../components/Loading'; +import { ScrollerBase } from '../components/ScrollerBase'; const fadeInAnimation = keyframes`${fadeIn}`; const alertIcon = require('../assets/alert-icon.svg'); -const Container = styled.div` +const Container = styled(ScrollerBase)` opacity: 0; animation: 500ms ${fadeInAnimation} 500ms; animation-fill-mode: forwards; - overflow: scroll; height: calc(100% - 27px); `; diff --git a/app/containers/Log.js b/app/containers/Log.js index 6fca942..9468040 100644 --- a/app/containers/Log.js +++ b/app/containers/Log.js @@ -4,12 +4,12 @@ import styled, { keyframes } from 'styled-components'; import { fadeIn } from 'react-animations'; import withSettings from './withSettings'; import getFontSize from '../util/get-font-size'; +import { ScrollerBase } from '../components/ScrollerBase'; const fadeInAnimation = keyframes`${fadeIn}`; -const LogScroller = styled.div` +const LogScroller = styled(ScrollerBase)` flex: 1; - overflow: scroll; padding: 30px; opacity: 0; animation: 500ms ${fadeInAnimation} 500ms; diff --git a/app/containers/Modules.js b/app/containers/Modules.js index 4856e90..27eeb1a 100644 --- a/app/containers/Modules.js +++ b/app/containers/Modules.js @@ -9,6 +9,7 @@ import Error from '../components/Error'; import Loading from '../components/Loading'; import withSettings from './withSettings'; import getFontSize from '../util/get-font-size'; +import { ScrollerBase } from '../components/ScrollerBase'; const fadeInAnimation = keyframes`${fadeIn}`; @@ -16,11 +17,10 @@ const ColorText = styled(Text) ` color: #00d0ff; `; -const Container = styled.div` +const Container = styled(ScrollerBase)` opacity: 0; animation: 500ms ${fadeInAnimation} 500ms; animation-fill-mode: forwards; - overflow: scroll; height: calc(100% - 27px); `; diff --git a/app/containers/Problems.js b/app/containers/Problems.js index 5acad57..0bb9318 100644 --- a/app/containers/Problems.js +++ b/app/containers/Problems.js @@ -8,10 +8,11 @@ import Error from '../components/Error'; import Loading from '../components/Loading'; import withSettings from './withSettings'; import getFontSize from '../util/get-font-size'; +import { ScrollerBase } from '../components/ScrollerBase'; const fadeInAnimation = keyframes`${fadeIn}`; -const ProblemContainer = withSettings(styled.div` +const ProblemContainer = withSettings(styled(ScrollerBase)` flex: 0; white-space: pre-wrap; font-family: 'menloregular'; @@ -20,7 +21,6 @@ const ProblemContainer = withSettings(styled.div` opacity: 0; animation: 500ms ${fadeInAnimation} 500ms; animation-fill-mode: forwards; - overflow: 'scroll'; height: calc(100% - 27px); `);