| stylesheet | R Documentation |
Parse termr stylesheets (RTCSS, a small CSS-like language) to style many
widgets at once by type, id, class and state. Pass them to
app(stylesheet = ) or app$add_stylesheet().
stylesheet(text, source = "<stylesheet>")
stylesheet_file(path)
text |
Stylesheet text. |
source |
Name used in error messages. |
path |
Path to a stylesheet file. |
Button { border: round; padding: 0 2; }
Button.danger { background: $error; }
#save { width: 20; }
Input:focus { border: heavy $accent; }
Vertical > Label { bold: true; }
Properties are the arguments of style() (border-color and
border_color both work). border also accepts a colour:
border: round cyan. Colours can refer to the theme: $primary.
Errors report the line, column and property.
Rules apply above a widget type's built-in style and below a widget's
own style. More specific selectors win (ids over classes and pseudo
classes over types); among equally specific rules, later ones win.
A termr_stylesheet.
sheet <- stylesheet("Button { border: round; } #save { background: $primary; }")
sheet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.