DocumentationMethacore Apps

Styling

8 min read · last updated 23 September 2026

Hosted apps look tidy without any effort on your part and adapt to the host's light or dark theme. If you want more – club colours, rounded buttons, your own tab bar – you write real CSS in styling.css. The file sits in the Code area next to app.json and main.js and is loaded after the built-in styles: it may override anything.

The tables on this page are generated from the runtime's STYLE_REFERENCE – the same source the built-in styles and the styling.css template are built from.

The quick way: variables

All components read their colours, spacing and radii from CSS variables. You can cover most needs by overriding a few of them in :root:

:root {
  --mc-color-primary: #0b7a3b;
  --mc-color-primary-soft: #e3f4ea;
  --mc-radius: 12px;
}
VariableDefaultUsed for
--mc-color-primary#4c6ef5Primary colour: primary buttons, active tabs, focus outline
--mc-color-primary-contrast#ffffffText on the primary colour
--mc-color-primary-soft#edf2ffLight shade of the primary colour, e.g. hover in tables, light buttons
--mc-color-text#1a1b1eText colour
--mc-color-muted#6b7280Muted text, labels, empty lists
--mc-color-background#ffffffBackground of the app and of input fields
--mc-color-surface#f8f9faBackground of cards and table headers
--mc-color-border#dee2e6Borders of cards, fields, tables and lists
--mc-color-danger#fa5252Colour for delete and errors
--mc-color-danger-contrast#ffffffText on the danger colour
--mc-radius8pxCorner radius of buttons, fields, cards and tables
--mc-font-familysystem-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serifFont of the app
--mc-font-size14pxBase font size
--mc-spacing16pxPadding of the app and of cards
--mc-gap12pxGap between elements in cards
--mc-button-padding8px 14pxPadding of buttons
--mc-button-font-weight600Font weight of buttons
--mc-input-height36pxMinimum height of input fields and selects
--mc-input-padding7px 10pxPadding of input fields
--mc-table-cell-padding8px 12pxPadding of table cells
--mc-tabs-indicatorvar(--mc-color-primary)Colour of the line under the active tab
--mc-shadow0 4px 16px rgba(0, 0, 0, 0.2)Shadow of notices (toasts)

Selectors

Every component carries fixed classes that do not change, and the data-mc-id attribute with its id from app.json. You assign your own classes in the builder under "CSS class" (in app.json: props.className).

SelectorWhat
.mc-appThe whole app
[data-mc-id="<id>"]Exactly one element; the builder shows the ID under the element's name
.mc-stackStack (layout)
.mc-gridGrid (layout)
.mc-cardCard
.mc-card__titleTitle of a card
.mc-headingHeading
.mc-heading--h1 … .mc-heading--h4Heading per level
.mc-textText
.mc-buttonButton
.mc-button--primaryFilled button (default)
.mc-button--secondaryLight, outlined or subtle button
.mc-button--dangerRed button
.mc-fieldLabel and input of a form field
.mc-inputText field
.mc-selectSelect
.mc-checkboxCheckbox with label
.mc-dateDate field
.mc-tableTable
.mc-table__headTable header
.mc-table__rowTable row
.mc-table__cellTable cell (also in the header)
.mc-listList
.mc-list__itemList entry
.mc-tabsTabs
.mc-tabs__listBar with the tab buttons
.mc-tabs__tabA tab button
.mc-tabs__tab--activeThe active tab button
.mc-tabs__panelContent of the active tab
.mc-imageImage
.mc-chartChart
.mc-emptyText shown when tables and lists have no entries
.mc-toastNotice outside a host

The classes follow a fixed pattern: .mc-<baustein> for the component, .mc-<baustein>__<teil> for its parts, .mc-<baustein>--<variante> for variants. Other classes and the HTML structure underneath are not guaranteed – rely only on the table above.

A button with the id speichern and the CSS class gross appears in the HTML like this:

<button type="button" class="mc-button mc-button--primary gross" data-mc-id="speichern">Speichern</button>

Examples

Club colours

:root {
  --mc-color-primary: #b3121b;
  --mc-color-primary-contrast: #ffffff;
  --mc-color-primary-soft: #fbe9ea;
  --mc-tabs-indicator: #b3121b;
}

/* In the dark theme the runtime sets its own colours – override them there as well. */
:root[data-mc-theme="dark"] {
  --mc-color-primary: #ff6b72;
  --mc-color-primary-contrast: #1a0507;
  --mc-color-primary-soft: #3a1416;
}

Pill-shaped buttons

.mc-button {
  border-radius: 999px;
  --mc-button-padding: 10px 20px;
}

.mc-button--primary {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-button--danger {
  background: transparent;
  color: var(--mc-color-danger);
}

Dark tab bar

.mc-tabs__list {
  background: #1a1b1e;
  border: none;
  border-radius: var(--mc-radius);
  padding: 4px;
}

.mc-tabs__tab {
  color: #adb5bd;
  border: none;
  border-radius: calc(var(--mc-radius) - 2px);
}

.mc-tabs__tab--active {
  background: #373a40;
  color: #ffffff;
}

Zebra table and highlighted column

.mc-table__row:nth-child(even) .mc-table__cell {
  background: var(--mc-color-surface);
}

[data-mc-id="termine"] .mc-table__cell:first-child {
  font-weight: 600;
}

A single element

[data-mc-id="heading-1"] {
  color: var(--mc-color-primary);
  font-size: 28px;
}

/* custom class from the builder */
.hinweis {
  border-left: 3px solid var(--mc-color-primary);
  padding-left: 12px;
}

Background image

.mc-app {
  background: url("https://cdn.example.de/verein/wappen.png") no-repeat right 16px top 16px / 64px;
}

What the security policy allows

Hosted apps run under a strict Content Security Policy. For CSS this means:

WhatAllowed?
styling.css and other .css files of the draftyes
Inline stylesyes
@import from external addressesno
Images in url(…) via https: or as data:yes
Images via http:no
Web fonts (@font-face, Google Fonts, also as data:)no – use system fonts via --mc-font-family

The full policy of the run shell:

default-src 'none'; script-src 'self' <runtime-cdn>; style-src 'self' 'unsafe-inline' <runtime-cdn>;
img-src https: data:; connect-src 'self' https://*.api.methacore.de <developer-portal-api>;
frame-ancestors <dashboard> <studio>; base-uri 'none'; form-action 'none'

Light and dark theme

On start, the host tells the app whether it is light or dark, and reports every change. The runtime then sets data-mc-theme="light" or "dark" on the <html> element. Outside a host it follows prefers-color-scheme.

In the dark theme the runtime overrides these variables: background, surface, text, muted text, border and the three primary colours. Because :root[data-mc-theme="dark"] is more specific than :root, the runtime wins there over your values in :root. If you want your colours in the dark theme too, also set them under :root[data-mc-theme="dark"] (see Club colours). If your app should always look the same, write both rules with the same values.

Check your styling in both themes before you submit a version.

The template

Every new app starts with this styling.css. It lists all variables with their default values; delete what you do not need.

/*
 * styling.css – custom app appearance with real CSS.
 *
 * This file is loaded after the built-in styles and may override anything.
 * The easiest way is to adjust the variables below. Every component also has fixed
 * classes (e.g. .mc-button, .mc-table__cell) and the data-mc-id attribute with its ID,
 * so you can target individual elements: [data-mc-id="button-1"] { … }
 * You assign your own classes in the builder under "CSS class".
 *
 * External files (@import, url() to external addresses) are blocked by the app's security policy.
 */

:root {
  /* Primary colour: primary buttons, active tabs, focus outline */
  --mc-color-primary: #4c6ef5;
  /* Text on the primary colour */
  --mc-color-primary-contrast: #ffffff;
  /* Light shade of the primary colour, e.g. hover in tables, light buttons */
  --mc-color-primary-soft: #edf2ff;
  /* Text colour */
  --mc-color-text: #1a1b1e;
  /* Muted text, labels, empty lists */
  --mc-color-muted: #6b7280;
  /* Background of the app and of input fields */
  --mc-color-background: #ffffff;
  /* Background of cards and table headers */
  --mc-color-surface: #f8f9fa;
  /* Borders of cards, fields, tables and lists */
  --mc-color-border: #dee2e6;
  /* Colour for delete and errors */
  --mc-color-danger: #fa5252;
  /* Text on the danger colour */
  --mc-color-danger-contrast: #ffffff;
  /* Corner radius of buttons, fields, cards and tables */
  --mc-radius: 8px;
  /* Font of the app */
  --mc-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Base font size */
  --mc-font-size: 14px;
  /* Padding of the app and of cards */
  --mc-spacing: 16px;
  /* Gap between elements in cards */
  --mc-gap: 12px;
  /* Padding of buttons */
  --mc-button-padding: 8px 14px;
  /* Font weight of buttons */
  --mc-button-font-weight: 600;
  /* Minimum height of input fields and selects */
  --mc-input-height: 36px;
  /* Padding of input fields */
  --mc-input-padding: 7px 10px;
  /* Padding of table cells */
  --mc-table-cell-padding: 8px 12px;
  /* Colour of the line under the active tab */
  --mc-tabs-indicator: var(--mc-color-primary);
  /* Shadow of notices (toasts) */
  --mc-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Examples – remove the comment markers to use them:

.mc-button--primary {
  border-radius: 999px;
  text-transform: uppercase;
}

.mc-table__row:nth-child(even) .mc-table__cell {
  background: var(--mc-color-surface);
}

[data-mc-id="heading-1"] {
  color: var(--mc-color-primary);
}
*/