Styling an HTML dialog modal to take the full height of the viewport
12 comments
·March 16, 2025VladVladikoff
dawnerd
Seriously. This would have been trivial with a few second look in inspector.
kevmo314
At that point in the article, I thought Natalie was some new LLM I hadn't heard about.
tonyedgecombe
If your only tool is a hammer then everything looks like a nail.
zx8080
> The spec lives in GitHub in a 7MB source file which is too large to view through the GitHub web interface
It's a bit offtopic, but think about it: cannot view the doc despite its size is only 7Mb ~ about 0.04 percent of a typical computer's memory (16Gb). We can open and view PDFs much bigger and search there without an issue in browser. We can view movies worth half of the memory.
But it's surprisingly not possible to view a 7Mb text file in the professional tool for working with textual source code called github. Shame. And sad.
sureIy
The file is 142k lines line that GitHub would have to turn into HTML and the browser would have to render immediately.
The browser is perfectly able to render the raw file (you can try it yourself) but everything that goes with it would be asking a bit much, particularly because the intent of the author was to blame the file, therefore adding yet more information/elements to the page.
While browsers nor GitHub are beacons of performance, I don’t think it's fair in this case.
PDFs can be rendered page by page and each page is self-contained. Same with videos, where you read the index and jump to the key frame you're onto, reading data in a highly optimized and parallelized way (often down to the chip). With HTML you must render every letter that comes before line 100000 before rendering line 100000
kevmo314
You might be surprised to learn that VS Code renders its viewport with HTML and it has no issues displaying this file.
ehutch79
7mb is a LOT of text. More than most epic fantasy novels.
While surely the text fits, it’s all the stuff around it like rendering and layout that take the memory.
uallo
> I was using Firefox. Natalie pointed out that Chrome DevTools display default browser styles for elements [...]
So does Firefox. Enable "Show Browser Styles" in the developer tools settings.
xg15
> I also found out today that the HTML Living Standard is very much a living standard - the whatwg/html repo has had 12,318 commits, the most recent of which was less than 24 hours ago.
I understand their mission of capturing the messy real-world usages of web technologies and distilling them into a standard, paving the cowpaths etc etc.
But I don't see how anything can be called a standard that updates daily.
sophiebits
For what it’s worth, the “normal” value of max-height is none, not inherit or 100vh.
MortyWaves
At this point I’m no longer shocked by shoddy poor defaults for elements or “user agent style” as they like to call it.
Seems like a good example of depending on LLMs too much. After the first bad output the next step should have been to open inspector, not to try three more LLMs.