Repository navigation
HTML and CSS into dmvsi documents - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dmvs_html: HTML and CSS into dmvsi documents
The first dmvsi converter: a static UI page (HTML, CSS, Tailwind CSS from its Play CDN, icon fonts like Font Awesome) is laid out as a browser lays it out and described as a dmvsi document. todmvs writes the dmview view of that document.
It has its own HTML parser, CSS cascade and layout in C, with no browser and no other dependencies, so it runs both at build time and on a device.
<style>,<link rel=stylesheet>andstyle=""are read;<script>is not run. A<script>loadingcdn.tailwindcss.comturns Tailwind on.!important, specificity, order) and inheritance;var(), andcalc()/min()/max()/clamp();:not()/:is()/:where(), and::before/::afterwithcontent;@media(evaluated against the viewport),@supports,@layer,@importand@font-face./opacitymodifier,sm:…2xl:variants, negative values and!.--tw-*custom properties.fr, spans);translate().box-shadow(outer and inset),filter: blur()/drop-shadow(), opacity.@font-face, matched as CSS matches fonts).todmvs -m URL=FILE). A mapped style sheet resolves relative URLs through the maps first, then next to its local file.Not in scope yet: JavaScript, floats and tables,
flex-wrap, rounded clipping (it clips to the rectangle), transforms other than translate, andbackdrop-filter.Debugging:
DMVS_HTML_DUMP=<file>writes every element's box as JSON, for comparing with a browser.Tests:
dmview/examples/dmodos/dmodos.dmvswas hand-written from) with its CDN resources mapped to fixtures. Boxes and text positions are compared with Chrome's layout (2 px tolerance).Measured on that page against Chrome:
Depends on dmvsi (and todmvs to make views).
🤖 Generated with Claude Code