🐛 inline CSS for PixelPerfectCanvas

main
Shad Amethyst 2 years ago
parent 04deb14753
commit fef0f2587f

@ -1,6 +1,6 @@
{ {
"name": "@shadryx/pptk", "name": "@shadryx/pptk",
"version": "0.1.1", "version": "0.1.2",
"description": "Pixel-Perfect ToolKit, a library to help make pixel-perfect applications on high-DPI devices", "description": "Pixel-Perfect ToolKit, a library to help make pixel-perfect applications on high-DPI devices",
"keywords": [ "keywords": [
"pixel-perfect", "pixel-perfect",

@ -1,3 +0,0 @@
.container {
overflow: hidden;
}

@ -1,6 +1,5 @@
import { JSX, Component, createEffect, onCleanup } from "solid-js"; import { JSX, Component, createEffect, onCleanup } from "solid-js";
import { attachCanvas, AttachCanvasOptions } from '../index.js'; import { attachCanvas, AttachCanvasOptions } from '../index.js';
import styles from './PixelPerfectCanvas.module.css';
export type PixelPerfectCanvasProps = { export type PixelPerfectCanvasProps = {
/** /**
@ -59,8 +58,11 @@ export const PixelPerfectCanvas: Component<PixelPerfectCanvasProps> = (props) =>
}); });
return (<div return (<div
style={props.style} style={{
class={[props.class, styles.container].filter(Boolean).join(' ')} ...props.style,
overflow: 'hidden'
}}
class={props.class}
ref={(div) => containerRef = div} ref={(div) => containerRef = div}
> >
<canvas ref={(canvas) => canvasRef = canvas}> <canvas ref={(canvas) => canvasRef = canvas}>

Loading…
Cancel
Save