File tree Expand file tree Collapse file tree 6 files changed +60
-15
lines changed
Expand file tree Collapse file tree 6 files changed +60
-15
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Renderer } from "../renderer";
22import { render , h } from "preact" ;
33import { getNearestElement , measureNode } from "../dom" ;
44import { ID } from "../../view/store/types" ;
5- import { Highlighter } from "../../view/components/Highlighter" ;
5+ import { Highlighter , style } from "../../view/components/Highlighter" ;
66
77/**
88 * This module is responsible for displaying the transparent element overlay
@@ -35,7 +35,7 @@ export function createHightlighter(renderer: Renderer) {
3535 if ( highlightRef == null ) {
3636 highlightRef = document . createElement ( "div" ) ;
3737 highlightRef . id = "preact-devtools-highlighter" ;
38- highlightRef . className = "foobar" ;
38+ highlightRef . className = style . outerContainer ;
3939
4040 document . body . appendChild ( highlightRef ) ;
4141 }
Original file line number Diff line number Diff line change 1+ import { h } from "../vendor/preact-10" ;
2+
3+ function Inner ( ) {
4+ return (
5+ < div
6+ style = { `
7+ background: #aaa;
8+ width: 100vh;
9+ position: absolute;
10+ left: 0;
11+ top: 0;
12+ height: 15rem;
13+ ` }
14+ >
15+ full width
16+ </ div >
17+ ) ;
18+ }
19+
20+ export function FullWidthHighlighter ( ) {
21+ return (
22+ < div style = "padding-top: 20rem" >
23+ < Inner />
24+ </ div >
25+ ) ;
26+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Stateful } from "./state";
77import { createRenderer } from "../../adapter/10/renderer" ;
88import { setupOptions } from "../../adapter/10/options" ;
99import { Booleans , Complex } from "./DataTypes" ;
10+ import { FullWidthHighlighter } from "./Highlighting" ;
1011
1112export function initPreact10 ( hook : DevtoolsHook ) {
1213 if ( hook . attachPreact ) {
@@ -27,18 +28,25 @@ export function initPreact10(hook: DevtoolsHook) {
2728export function renderExamples10 ( node : HTMLElement ) {
2829 render (
2930 < div >
30- < p > Todo list</ p >
31- < TodoList />
32- < p > Legacy context</ p >
33- < LegacyContext />
34- < p > Class state</ p >
35- < Stateful />
36- < p > Data Types</ p >
37- < Booleans value = { true } />
38- < Complex />
39- < p > Deep tree</ p >
40- < DeepTree />
41- < br />
31+ { /* <FullWidthHighlighter /> */ }
32+ < div style = "padding: 2rem" >
33+ < p > Highlight full width</ p >
34+ < small >
35+ Uncomment all other components so that the vertical scrollbar is gone
36+ </ small >
37+ < p > Todo list</ p >
38+ < TodoList />
39+ < p > Legacy context</ p >
40+ < LegacyContext />
41+ < p > Class state</ p >
42+ < Stateful />
43+ < p > Data Types</ p >
44+ < Booleans value = { true } />
45+ < Complex />
46+ < p > Deep tree</ p >
47+ < DeepTree />
48+ < br />
49+ </ div >
4250 </ div > ,
4351 node ,
4452 ) ;
Original file line number Diff line number Diff line change @@ -41,11 +41,11 @@ wrapper.style.cssText = `
4141` ;
4242const container = div ( "container" ) ;
4343container . style . cssText = `
44- padding: 2rem;
4544 overflow: auto;
4645` ;
4746
4847const examples10 = div ( "preact-10" ) ;
48+ examples10 . style . cssText = "position: relative" ;
4949document . body . appendChild ( wrapper ) ;
5050wrapper . appendChild ( container ) ;
5151wrapper . appendChild ( devtools ) ;
Original file line number Diff line number Diff line change 7272.fixed .fixedBottom {
7373 bottom : 1.5em ;
7474}
75+
76+ .outerContainer {
77+ position : absolute;
78+ top : 0 ;
79+ left : 0 ;
80+ right : 0 ;
81+ bottom : 0 ;
82+ overflow : hidden;
83+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { h } from "preact";
22import s from "./Highlighter.css" ;
33import { Measurements } from "../../adapter/dom" ;
44
5+ export const style = s ;
6+
57export interface Props extends Measurements {
68 label : string ;
79}
You can’t perform that action at this time.
0 commit comments