> ## Documentation Index
> Fetch the complete documentation index at: https://developers.appstle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Style the Appstle Memberships member portal with custom CSS

> How to restyle the Appstle Memberships member portal on your storefront with the Member Portal CSS box: where the CSS applies, which properties the portal keeps, the class names to target, and a tested example.

The member portal is the page where your members see their memberships, upcoming renewals and payment details, and cancel. You restyle it with the **Member Portal CSS** box in the Appstle Memberships app. Appstle limits your CSS to the portal and keeps only the properties listed on this page, so a rule can't change the rest of your store.

Use this page to write that CSS yourself, or to give it to an AI assistant that writes it for you: the [brief for an AI assistant](#brief-for-an-ai-assistant) holds everything the assistant needs in one block.

> [!WARNING]
>
> **The portal's class names can change.** Unlike the APIs and the JavaScript events, they aren't a supported interface, and a portal update can change them without notice. Check your styles after an app update. To change what the portal does rather than how it looks, use the [JavaScript events](https://developers.appstle.com/memberships/javascript-events.md) or build your own front end on the [Storefront API](https://developers.appstle.com/memberships/authentication.md#storefront-api-authentication).

## 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](#how-your-css-is-applied) to override the rest.

**3. Save**

Click **Save**, then reload your member portal page on the storefront.

You can read the saved CSS from your server with the Admin API call [Get custom CSS styling configuration](https://developers.appstle.com/memberships-admin-api/custom-css-styling/get-custom-css-styling-configuration.md), with your API key in the `X-API-Key` header (see [Authentication](https://developers.appstle.com/memberships/authentication.md)). 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.

```bash theme={null}
curl -s "https://membership-admin.appstle.com/api/external/v2/subscription-custom-csses/0" \
  -H "X-API-Key: YOUR_API_KEY"
```

The path needs a number, but the call ignores it and returns your store's record. The response is trimmed here: each CSS value is cut to its first rule.

```json theme={null}
{
  "id": 12345,
  "shop": "your-store.myshopify.com",
  "customCss": null,
  "customerPoratlCSS": ".appstle-customer-portal .card { border: 1px solid rgba(0,0,0,0.12) !important; … }",
  "bundlingCSS": null,
  "bundlingIframeCSS": null
}
```

## Where the CSS applies

| Where | Does the box style it? |
| - | - |
| The member portal on your storefront, at the app proxy page (`/apps/memberships` by default) | Yes |
| A page where you [embed the portal](https://developers.appstle.com/memberships/javascript-events.md#embed-the-customer-portal-on-a-page) | Yes |
| The cancel confirmation popup | Yes |
| The membership page inside Shopify's new customer accounts (the **Membership management** extension) | No. It uses Shopify's own components and has no class names to target. |
| Email notifications | No |
| The Appstle widgets on your product pages | No. They have their own **Widget CSS** box under **Settings** > **Customizations**. |

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.
* `:root` stands for the portal and for the popup. Put custom properties (CSS variables), and anything both should share, such as `font-family`, in a `:root` rule.
* 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-portal` doesn't reach the popup, so leave it off your `.appstle-modal-wrapper__*` selectors.
* A rule for `body` or `html` itself matches nothing, because both are outside the portal. Style `.appstle-customer-portal` instead.
* States such as `:hover` and `:focus` work. Pseudo-elements such as `::before`, `::after` and `::placeholder` don'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 `!important` to its declarations. A declaration with `!important` wins 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, `@media` rules and `@font-face` rules 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

| Group | Properties |
| - | - |
| Color and effects | `color`, `opacity`, `visibility`, `accent-color`, `caret-color`, `cursor`, `box-shadow` |
| Background | `background` and every `background-*` property, as long as the value has no `url()` |
| Borders and outlines | `border`, `outline` and every `border-*` and `outline-*` property, except `border-image` and its longhands |
| Text and fonts | `font` and every `font-*` property, every `text-*` property (such as `text-transform`, `text-align`, `text-decoration`, `text-shadow`, `text-overflow`), `line-height`, `letter-spacing`, `white-space`, `vertical-align` and every `word-*` property |
| Size | `width`, `height`, `min-*`, `max-*`, `aspect-ratio`, `box-sizing`, `object-*` |
| Spacing | `margin`, `padding`, `gap`, `row-gap` and every `margin-*` and `padding-*` property |
| Layout | `display`, `order`, `columns`, `flex`, `grid`, `overflow` and every `column-*`, `flex-*`, `grid-*`, `align-*`, `justify-*`, `place-*` and `overflow-*` property |
| Motion | `transition` and every `transition-*` property |
| Other | `list-style` and every `list-style-*` property, `appearance` |
| Custom properties | Any name that starts with `--` and uses only letters, digits, `-` and `_` |

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

| Dropped | Examples |
| - | - |
| Properties that aren't in the table | `position`, `top`, `left`, `inset`, `z-index`, `float`, `transform`, `animation`, `filter`, `backdrop-filter`, `clip-path`, `content`, `pointer-events`, `user-select`, `resize`, `table-layout`, `will-change`, `mix-blend-mode`, `scroll-behavior`, `fill` |
| Vendor-prefixed properties | `-webkit-line-clamp`, `-webkit-font-smoothing`, `-webkit-appearance`, `-moz-osx-font-smoothing` |
| Any value with `url()`, so no background images | `background-image: url(...)`, `background: url(...) no-repeat` |
| `border-image` | `border-image: linear-gradient(...) 1` |
| Negative margins, and `calc()` or `var()` in a margin | `margin-top: -8px`, `margin-left: calc(1rem + 2px)`, `margin-bottom: var(--gap)` |
| At-rules other than `@media` and `@font-face` | `@import`, `@keyframes`, `@supports` |
| `@font-face` rules without an `https` font file | `src: url('/font.woff2')`, `src: url('http://...')`, `src: local(...)`, `data:` URLs |

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 with `appstle_badge`, as in `.appstle_badge.appstle_ACTIVE`.

| Class | What it is |
| - | - |
| `.appstle-customer-portal` | The portal's outer element. |
| `.card`, `.card-header`, `.card-body` | The membership cards and the collapsible sections on the membership page (**Membership Details**, **Upcoming Renewals** and so on), with their headers and bodies. Other boxes in the portal use `.card` too. |
| `.appstle_sub-title` | The membership title in the card header. |
| `.appstle_membership_contract_title`, `.appstle_sub-title_product_name`, `.appstle_sub-title_frequency` | The parts of the membership's name and billing frequency. |
| `.appstle-membership-contract-number` | The membership number in a card header on the list page. |
| `.appstle_badge` | The status badge. Add `.appstle_ACTIVE`, `.appstle_PAUSED` or `.appstle_CANCELLED`, the membership's status. Upcoming renewals use `.appstle_QUEUED` and `.appstle_SKIPPED`. |
| `.appstle-next-renewal-date` | The "Next Renewal Date" line. |
| `.appstle_contract_see_more` | The links around the **See more details** and **Go Back** buttons. |
| `.appstle_order-detail_update-button` | The main action buttons, including **See more details** and **Go Back**. |
| `.appstle_order-detail_cancel-button` | The secondary button next to an update button, such as **Cancel** on an edit form. |
| `.appstle_back_to_account_link` | The **Back to Account** button at the top of the list. |
| `.appstle_greeting_header`, `.appstle_greeting_text` | The greeting at the top of the list. It shows for a customer who is signed in to your store, not for one who opened a sign-in link from an email. |
| `.appstle_currentMembershipPlanCard`, `.appstle_currentMembershipPlanText` | The current plan card on the membership page. |
| `.appstle_updatePaymentButton` | The payment method buttons. |
| `.appstle_skipOrderButton` | The skip button on an upcoming renewal. |
| `.appstle_cencelSubscription` | The cancel button in the **Cancel Membership** section. The class name is spelled `cencel`. |
| `.appstle_accept_retention_button`, `.appstle_cancelButton` | The buttons of a retention offer shown before cancelling. **Accept** and **Pause Membership** have the first class, and **Close** has the second. |
| `.appstle-modal-wrapper__panel` | The box of the cancel confirmation popup. |
| `.appstle-modal-wrapper__header`, `.appstle-modal-wrapper__title`, `.appstle-modal-wrapper__close`, `.appstle-modal-wrapper__body`, `.appstle-modal-wrapper__footer` | The parts of the popup. `.appstle-modal-wrapper__close` is the **×** button. |
| `.appstle-modal-wrapper__btn` | Both buttons in the popup's footer. **Keep My Membership** also has `.appstle-modal-wrapper__btn--primary-keep`, and **Confirm cancellation** has `.appstle-modal-wrapper__btn--danger-outline`. |
| `.appstle-modal-wrapper__backdrop-overlay` | The dimmed layer behind the popup. |

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.

```css theme={null}
/* Brand color and font for the portal and its popups */
:root {
  --portal-accent: #1f6f5c;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* Membership title: no capitals, a little more spacing */
.appstle-customer-portal .appstle_sub-title {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}

/* "Active" badge */
.appstle-customer-portal .appstle_badge.appstle_ACTIVE {
  background-color: #e6f4ef !important;
  color: var(--portal-accent) !important;
}

/* "See more details", "Go Back" and the other action buttons */
.appstle-customer-portal .appstle_order-detail_update-button {
  background-color: var(--portal-accent) !important;
  border-radius: 999px !important;
}
.appstle-customer-portal .appstle_order-detail_update-button:hover {
  opacity: 0.85;
}

/* Cancel confirmation popup: these selectors don't start with .appstle-customer-portal */
.appstle-modal-wrapper__panel {
  border-radius: 16px;
}
.appstle-modal-wrapper__btn--danger-outline {
  border-radius: 999px;
}

/* Small screens */
@media (max-width: 600px) {
  .appstle-customer-portal .appstle_sub-title {
    font-size: 16px !important;
  }
}
```

## 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.

```text wrap theme={null}
Write CSS for the Appstle Memberships member portal. Return only CSS, to be pasted at the end of the Member Portal CSS box.

Rules of the portal's CSS box:
- Write ordinary selectors. The portal restricts them to the portal (.appstle-customer-portal) and to its cancel confirmation popup (.appstle-modal-wrapper__dialog), which sits outside the portal.
- :root is the portal and the popup. Put CSS variables and font-family in :root. A rule for body or html itself does nothing.
- The box can already hold sample rules that use !important and selectors that start with .appstle-customer-portal. Start every selector for a portal element with .appstle-customer-portal and add !important, so your rules win. Never start a .appstle-modal-wrapper__ selector with .appstle-customer-portal: it would match nothing.
- Many elements have inline styles, so add !important to a declaration that has no effect.
- Hover and focus states work. Pseudo-elements (::before, ::after, ::placeholder) don't.
- Allowed properties: color, opacity, visibility, accent-color, caret-color, cursor, box-shadow, background and background-*, border and border-* (not border-image), outline and outline-*, font and font-*, text-*, line-height, letter-spacing, white-space, vertical-align, word-*, width, height, min-*, max-*, aspect-ratio, box-sizing, object-*, margin and margin-*, padding and padding-*, gap, row-gap, column-*, columns, display, order, flex and flex-*, grid and grid-*, align-*, justify-*, place-*, overflow and overflow-*, transition and transition-*, list-style and list-style-*, appearance, and custom properties (--name, with letters, digits, - and _ only).
- Everything else is dropped, including position, top, left, inset, z-index, float, transform, animation, filter, content, pointer-events, clip-path and every vendor-prefixed property (-webkit-*, -moz-*).
- No url() in any value, so no background images. calc() and var() are fine, but not in margin properties, and margins can't be negative.
- Allowed at-rules: @media, and @font-face with https font files only. @import, @keyframes and @supports are dropped, so load a web font with an @font-face rule that points at the font file's https address, never with an @import. If you don't know the exact file address, leave a clear placeholder and say so. Don't nest rules.
- The whole box, rules already in it included, must stay at 65,536 characters or fewer, and every brace must be closed. One syntax error drops all of it.

Class names in the portal:
.appstle-customer-portal (outer element), .card, .card-header, .card-body (membership cards and the collapsible sections, with their headers and bodies), .appstle_sub-title (card title), .appstle_membership_contract_title, .appstle_sub-title_product_name, .appstle_sub-title_frequency, .appstle-membership-contract-number, .appstle_badge with .appstle_ACTIVE, .appstle_PAUSED, .appstle_CANCELLED, .appstle_QUEUED or .appstle_SKIPPED (status badges), .appstle-next-renewal-date, .appstle_contract_see_more, .appstle_order-detail_update-button (main buttons), .appstle_order-detail_cancel-button (secondary buttons), .appstle_back_to_account_link, .appstle_greeting_header, .appstle_greeting_text, .appstle_currentMembershipPlanCard, .appstle_currentMembershipPlanText, .appstle_updatePaymentButton, .appstle_skipOrderButton, .appstle_cencelSubscription (cancel button), .appstle_accept_retention_button, .appstle_cancelButton (retention offer buttons).

Class names in the cancel confirmation popup:
.appstle-modal-wrapper__panel, .appstle-modal-wrapper__header, .appstle-modal-wrapper__title, .appstle-modal-wrapper__close, .appstle-modal-wrapper__body, .appstle-modal-wrapper__footer, .appstle-modal-wrapper__btn, .appstle-modal-wrapper__btn--primary-keep (keep the membership), .appstle-modal-wrapper__btn--danger-outline (confirm the cancellation), .appstle-modal-wrapper__backdrop-overlay.
```

## Next steps

> [card] [JavaScript events and portal embed](https://developers.appstle.com/memberships/javascript-events.md)
>
> Start the portal from your own code and react when it is on the page.

> [card] [Build your own front end](https://developers.appstle.com/memberships/authentication.md#storefront-api-authentication)
>
> Replace the portal with your own screens on the Storefront API.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.