mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-17 22:18:41 -09:00
Scrollbar to respect dpr
This commit is contained in:
parent
c4f05dbb1c
commit
b19bc74001
1 changed files with 4 additions and 1 deletions
|
|
@ -1,14 +1,17 @@
|
|||
import React, {forwardRef} from 'react';
|
||||
|
||||
import type {StyleSheetProps} from '../../typings/hyper';
|
||||
import { useDevicePixelRatio } from 'use-device-pixel-ratio';
|
||||
|
||||
const StyleSheet = forwardRef<HTMLStyleElement, StyleSheetProps>((props, ref) => {
|
||||
const {borderColor} = props;
|
||||
|
||||
const dpr = useDevicePixelRatio();
|
||||
|
||||
return (
|
||||
<style jsx global ref={ref}>{`
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
width: ${5 * dpr}px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 10px;
|
||||
|
|
|
|||
Loading…
Reference in a new issue