Coming from HTML and CSS¶
ArcRmlUI documents look like web pages: tags, classes, a style sheet, flexbox. They are not a browser. This page lists what changes for a web developer, section by section. Each section says what you do in HTML and what you do here.
The document¶
Every tag must be closed, because the parser is an XML parser, not an HTML5 one:
- Void tags are self-closed:
<br/>,<img/>,<input/>. A bare<br>fails with "an element is not closed". - There is no DOCTYPE; leave it out.
- Entities:
<,>,&,", numeric references and in text work.'and named entities such as©stay literal text. - A missing
<body>becomes an empty one.
In HTML you write an .html file. Here the file is .rml, with a root <rml> or <html>. Only .rml and .rcss
files load.
The head takes four things:
<title>: stored, shown nowhere.<link type="text/rcss" href="page.rcss"/>:typeandhrefare both required,relis ignored, and the file must end in.rcss.<link rel="stylesheet" href="page.css"/>logs "Link tag requires type and href attributes".<meta name="..." content="..."/>: only the eight names Documents lists, each once.charset,viewportand the like are errors.<viewmodel>: the data a document reads, see View models.
An inline <style>, a <script>, <template>, <link type="text/template"> and <body template> are compile errors.
Styles go in a linked .rcss file; the style attribute works.
The converter turns an HTML page into this. An example shows the Converter sample's page and
its result. The changed lines: the <!DOCTYPE>, <meta charset>, the two font <link> tags, the <script> and the
onclick are gone, <html> is <rml>, page.css is linked as page.rcss with type="text/rcss", and <br> is <br/>.
Paths and images¶
A path that starts with / is a package path, /<Mount>/UI/Rml/Shared/Samples.rcss, where <Mount> is Game or a
plugin the project loads. Any other path is relative to the document.
Images are png files, or svg files drawn by <svg>; the cook ships only svg, png, ttf and otf from a content root. An image can
also come from a texture asset: src="asset:/Package/Path.Object" draws a Texture2D without virtual texture streaming
(Images). No font ships with the plugin,
and a web font link does not load: declare each font in a font sheet, see Project setup.
Elements that behave differently¶
Every tag the table does not name is a generic element styled by the default style sheet; an unknown tag is inline.
| Tag | Difference from HTML |
|---|---|
input |
Types: text (default), password, radio, checkbox, range, submit, button, reset. number, email, date, file, color and search behave as text. hidden is display: none. |
button |
Never submits a form. |
form |
Does not navigate. Clicking an input type="submit" inside it fires a submit event carrying the named values. |
select, option |
No optgroup. Up and Down on a closed select move focus instead of changing the value. |
label |
Targets for, or else its first descendant control. |
progress |
max defaults to 1; direction takes top, right, bottom, left, clockwise and counter-clockwise; a fill child draws the bar. |
img |
src, plus rect (crop) and sprite. No alt, no srcset. |
a |
No href behaviour. Use data-action or on:click. |
textarea |
rows, cols, maxlength, wrap. |
Not present: iframe, video, audio, canvas, links between pages, the DOM. <svg> works with a src file.
Text fields and focus: Text fields, Navigation.
No JavaScript¶
A <script> is a compile error and no on* handler runs. What replaces it:
- Data: a view model (
UMVVMViewModelBase, C++ or Blueprint) is declared in the head and read with binding attributes. View models, Data binding. - Click handlers:
on:click="call(...)"calls a view model function. Events. - Navigation:
data-action="close"ordata-action="open:<package path>"closes the document or opens another. Events. - Tabs and frames: Frames and tabs.
CSS¶
Most of what a game UI uses works: the box model, position (static, relative, absolute, fixed), float, flexbox, grid,
aspect-ratio, shadows, transforms, transitions and animations, var(), calc(), gradients, @media, @keyframes,
@font-face, nesting, and the modern colour syntaxes. The full tables, with what is partial, are in
CSS support.
The gaps a web developer meets first:
position: sticky,columns,writing-mode,clip-path,resize,scroll-snap-*,container-typedo not exist.:has(),:target,:visited,:validand:invalidnever match.@layerorders the cascade as in Chrome.@containerblocks apply their rules unconditionally, without the condition, and log an "Unknown at-rule" warning, which is expected.@importis not followed: link each sheet from the document.- Units
ex,chandlhand the functionsenv()andhwb()are not supported.
Where the default style sheet differs from a browser:
- The sheet follows Chrome's (
bodymargin 8px, headings, lists, tables, 13.33px sans-serif controls), with one addition:input,select,textareaandbuttonare arrow-key stops (nav: auto). - No font ships. A rule with no
font-familyuses the configured fallback family.
A declaration ArcRmlUI drops is reported as a warning, except for the browser-only items listed under Not supported, the declarations of a rule
whose selectors can never match (such as ::backdrop or a vendor-prefixed pseudo), and a -webkit- or -moz- property
whose unprefixed twin parsed in the same rule; for example "Declaration 'columns: 2;' is dropped: unknown
property 'columns'." or "... is dropped: invalid value.". The warning shows in the log of every build that is not
a Shipping build, and the validator reports the same text before you run the game. A malformed block drops
the rest of its sheet.
Bring a page over¶
- Converting an HTML page: the editor converts a
.htmlfile into.rmland.rcss, removing what cannot run. The Converter sample's input and output are in An example. - Tailwind CSS: build a utility-class sheet with the standalone CLI and link it. The sample is
Tailwind/Tailwind.rml(an excerpt):
<rml>
<head>
<title>Tailwind</title>
<meta name="layer" content="UI.Layer.Menu"/>
<meta name="input-mode" content="menu"/>
<link type="text/rcss" href="/ArcRmlUISamples/UI/Rml/Shared/Samples.rcss"/>
<link type="text/rcss" href="Tailwind.rcss"/>
</head>
<body>
<div class="absolute top-20 left-20 w-[720px] rounded-xl bg-slate-800 p-8 shadow-lg">
<h1 class="text-3xl font-bold text-sky-400">Tailwind in RML</h1>
<p class="mt-2 text-slate-300">Every style on this screen comes from Tailwind utility classes.</p>
<!-- ... a button row, a divide-y list and a grid-cols-3 block ... -->
</div>
</body>
</rml>
Next¶
- CSS support: the full tables, with what is partial.
- Project setup: fonts, layers and input for the first document.
- Quick start: open a first document from C++ or Blueprint.