summaryrefslogtreecommitdiffstats
path: root/docs/modules/ROOT/pages
diff options
context:
space:
mode:
authorDan Allen <dan@opendevise.com>2018-02-09 14:17:24 -0700
committerDan Allen <dan@opendevise.com>2018-02-09 19:47:52 -0700
commit02ee6c898061aec6f1105d484c701afa08b5470c (patch)
tree48ac3913b4599deceaf57c769ec83ef14bc14c45 /docs/modules/ROOT/pages
parent33894db899f931aa92b87e96ed0326714126ca95 (diff)
downloadalpine-antora-theme-02ee6c898061aec6f1105d484c701afa08b5470c.tar.bz2
alpine-antora-theme-02ee6c898061aec6f1105d484c701afa08b5470c.tar.xz
document the UI elements and how to style them
Diffstat (limited to 'docs/modules/ROOT/pages')
-rw-r--r--docs/modules/ROOT/pages/style-guide.adoc63
1 files changed, 63 insertions, 0 deletions
diff --git a/docs/modules/ROOT/pages/style-guide.adoc b/docs/modules/ROOT/pages/style-guide.adoc
index 11e5831..fc69f67 100644
--- a/docs/modules/ROOT/pages/style-guide.adoc
+++ b/docs/modules/ROOT/pages/style-guide.adoc
@@ -5,6 +5,7 @@ endif::[]
// Settings:
:idprefix:
:idseparator: -
+:experimental:
When creating a UI theme for Antora, there are certain elements in the UI that require support from the CSS to work correctly.
This list includes elements in the shell (i.e., frame) and in the document content.
@@ -87,3 +88,65 @@ Here's how it might appear:
* [ ] todo
* [*] done!
+
+=== UI Elements
+
+Asciidoctor supports three UI element representations out of the box, which are made from corresponding inline UI macros.
+
+* keybinding (kbd macro)
+* button (btn macro)
+* menu (menu macro)
+
+The UI elements are output using semantic HTML elements, so they inherit some default styling from the browser.
+However, to look proper, they require some additional styling.
+
+==== Keybinding
+
+A keybinding can be a single key (`+kbd:[F11]+`) or a sequence of keys (`+kbd:[Ctrl+F]`).
+Here's the HTML that's generated for these two forms.
+
+[source,html]
+----
+<kbd>F11</kbd>
+<span class="keyseq"><kbd>Ctrl</kbd>+<kbd>F</kbd></span>
+----
+
+Here's how these might appear:
+
+[%hardbreaks]
+kbd:[F11]
+kbd:[Ctrl+F]
+
+==== Button
+
+A button is meant to represent an on-screen button (`+btn:[Save]+`).
+However, it should not appear like an actual button as that could confuse the reader into thinking it's interactive.
+Therefore, a button is rendered as a bold text by default:
+
+[source,html]
+----
+<b class="button">Save</b>
+----
+
+Traditionally, a button reference is styled by surrounding the text with square brackets, as shown here:
+
+btn:[Save]
+
+==== Menu
+
+A menu can be a top-level menu reference (`+menu:File[]+`) or a nested selection (`+menu:File[Save]+`).
+Here's the HTML that's generated for these two forms.
+
+[source,html]
+----
+<b class="menuref">File</b>
+<span class="menuseq"><b class="menu">File</b>&#160;<b class="caret">&#8250;</b> <b class="menuitem">Save</b></span>
+----
+
+This might be rendered as:
+
+[%hardbreaks]
+menu:File[]
+menu:File[Save]
+
+The default styling applied to a menu reference is usually sufficient.