From ed990d473b5c2d7ba0bef793e0e39f1f618b838b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Pe=C3=B1a?= Date: Sat, 7 Jan 2017 20:50:00 -0500 Subject: [PATCH] Scrollbar Fix on Mac. Fixes issue #100 (#1354) * Fix Scrollbar appearance on webkit mac * fix linting issues --- lib/components/term.js | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/lib/components/term.js b/lib/components/term.js index db71fde2..489f9a1c 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -219,19 +219,30 @@ export default class Term extends Component { font-size: ${this.props.fontSize}px; } `; - const osSpecificCss = process.platform === 'win32' ? - `::-webkit-scrollbar { - width: 5px; - } - ::-webkit-scrollbar-thumb { - -webkit-border-radius: 10px; - border-radius: 10px; - background: ${this.props.borderColor}; - } - ::-webkit-scrollbar-thumb:window-inactive { - background: ${this.props.borderColor}; - }` : '' - ; + let osSpecificCss = ''; + if (process.platform === 'win32') { + osSpecificCss = `::-webkit-scrollbar { + width: 5px; + } + ::-webkit-scrollbar-thumb { + -webkit-border-radius: 10px; + border-radius: 10px; + background: ${this.props.borderColor}; + } + ::-webkit-scrollbar-thumb:window-inactive { + background: ${this.props.borderColor}; + }`; + } else if (process.platform === 'darwin') { + osSpecificCss = `::-webkit-scrollbar { + width: 9px; + background: transparent; + } + ::-webkit-scrollbar-thumb { + -webkit-border-radius: 10px; + border-radius: 10px; + -webkit-box-shadow: inset 0 0 0 1px ${this.props.borderColor}; + }`; + } return URL.createObjectURL(new Blob([` .cursor-node[focus="false"] { border-width: 1px !important;