Where to add the CSS
1
Open the box
In the Appstle Memberships app, go to Settings > Customizations > Member Portal CSS. The box is on every plan.
2
Write or paste your CSS
Add your rules to the Custom CSS editor, below any rules already there. New installs start with sample rules for cards, status badges and buttons. Keep the ones you want, and see How your CSS is applied to override the rest.
3
Save
Click Save, then reload your member portal page on the storefront.
X-API-Key header (see Authentication). Never put the key in browser code. The CSS is in the customerPoratlCSS field of the response (the field name is spelled that way). The API can’t change it: write the CSS in the app.
Where the CSS applies
By default, the portal is drawn inside an
iframe on your page, so your theme’s stylesheet and fonts don’t reach it. Set the fonts and colors you want in the box. Two theme colors can reach it: when your theme sets the CSS variables --color-foreground and --color-background on the page’s root element, the portal copies their values, and the sample rules use them. Otherwise the portal sets them to dark gray and white.
How your CSS is applied
Write your selectors the way you would in any stylesheet. The portal changes every selector before it uses it, so the rule can only reach elements inside the portal or inside the cancel confirmation popup:- Your rules apply inside the portal,
.appstle-customer-portal, and inside the cancel confirmation popup,.appstle-modal-wrapper__dialog. The popup sits outside the portal on the page, so the portal repeats your rules for it. :rootstands for the portal and for the popup. Put custom properties (CSS variables), and anything both should share, such asfont-family, in a:rootrule.- A selector can start with
.appstle-customer-portal, and.appstle-customer-portal { ... }styles the portal’s outer element. A selector that starts with.appstle-customer-portaldoesn’t reach the popup, so leave it off your.appstle-modal-wrapper__*selectors. - A rule for
bodyorhtmlitself matches nothing, because both are outside the portal. Style.appstle-customer-portalinstead. - States such as
:hoverand:focuswork. Pseudo-elements such as::before,::afterand::placeholderdon’t: a rule that ends in one has no effect. - Some portal elements have inline styles, and the portal’s own rules can be more specific than yours. If a rule has no effect, add
!importantto its declarations. A declaration with!importantwins over an inline style. One without it doesn’t. - The sample rules that new installs start with use
!important, and many of their selectors start with.appstle-customer-portal. To override one, use a selector that is at least as specific, such as one that starts with.appstle-customer-portal, add!important, and put your rule below it. Or change the sample rule itself. - Rules for several selectors,
@mediarules and@font-facerules work. You can’t nest a rule inside a rule: the portal drops the inner rule and keeps the outer one.
What the portal keeps
The portal reads your CSS in the shopper’s browser and drops everything it doesn’t allow, without an error message. A declaration the browser doesn’t understand is dropped too, as usual.Properties the portal keeps
A property from the table with a value that contains one of these is dropped:
url(, attr(, env(, image(, image-set(, element(, src(, expression(, or the characters {, }, <, > and \. calc() and var() work, except in a margin property, and a margin value can’t be negative.
What the portal drops
An
@font-face rule is kept when its src is one or more https url() files, with an optional format('woff'), format('woff2'), format('truetype') or format('opentype'). It keeps font-family, font-style, font-weight, font-display, font-stretch and unicode-range. To use a custom font, point src at the https address of a font file on a host that allows cross-origin font requests. For a Google Font, don’t paste its @import line, because the portal drops it. Instead, open the font’s stylesheet address (https://fonts.googleapis.com/css2?family=...) in your browser, paste the @font-face block under /* latin */ into the box as it is, and name the font in your :root rule’s font-family.
Limits
- The portal applies your CSS only when the whole box, sample rules included, holds 65,536 characters or fewer. The box saves more, but then the portal applies none of it.
- If the CSS can’t be parsed, for example because of a missing closing
}, the portal applies none of it. When a rule has no effect, check the rest of the box for a syntax error.
Class names
These are the class names on the portal’s screens today. Use the status classes together withappstle_badge, as in .appstle_badge.appstle_ACTIVE.
Some elements also carry the portal’s own layout classes (
.btn, .btn-primary, .badge). Don’t rely on them to target one element: the same class is on many.
Example
This CSS sets a brand color and a font, and restyles the title, the status badge, the buttons and the cancel confirmation popup. It also makes the title smaller on a phone. Paste it at the end of the box, below any rules already there. The portal keeps every rule in it, and its rules win over the sample rules that new installs start with.Brief for an AI assistant
Copy this block into your AI assistant together with what you want the portal to look like. Paste the CSS it returns at the end of the Member Portal CSS box, then reload the portal and check it.Next steps
JavaScript events and portal embed
Start the portal from your own code and react when it is on the page.
Build your own front end
Replace the portal with your own screens on the Storefront API.