mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 06:28:40 -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 React, {forwardRef} from 'react';
|
||||||
|
|
||||||
import type {StyleSheetProps} from '../../typings/hyper';
|
import type {StyleSheetProps} from '../../typings/hyper';
|
||||||
|
import { useDevicePixelRatio } from 'use-device-pixel-ratio';
|
||||||
|
|
||||||
const StyleSheet = forwardRef<HTMLStyleElement, StyleSheetProps>((props, ref) => {
|
const StyleSheet = forwardRef<HTMLStyleElement, StyleSheetProps>((props, ref) => {
|
||||||
const {borderColor} = props;
|
const {borderColor} = props;
|
||||||
|
|
||||||
|
const dpr = useDevicePixelRatio();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<style jsx global ref={ref}>{`
|
<style jsx global ref={ref}>{`
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 5px;
|
width: ${5 * dpr}px;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
-webkit-border-radius: 10px;
|
-webkit-border-radius: 10px;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue