Skip to content

Update styling.md for CSS custom properties clarification - #1612

Open
gunayanil wants to merge 1 commit into
stenciljs:mainfrom
gunayanil:patch-1
Open

Update styling.md for CSS custom properties clarification#1612
gunayanil wants to merge 1 commit into
stenciljs:mainfrom
gunayanil:patch-1

Conversation

@gunayanil

@gunayanil gunayanil commented Aug 8, 2026

Copy link
Copy Markdown

I think the current note is a bit confusing/misleading if I understand it correctly. It indicates that a CSS custom property must first be declared on :host to be exposed to the consuming application, but I don't think this is the case.

For example, this works without declaring the CSS custom property on :host:

:host {
  display: block;
}

.heading {
  color: var(--heading-color, black);
}

Even color: var(--heading-color); should work fine too.

Then in consumer:

shadow-card {
  --heading-color: blue;
}

Here, shadow-card is the host element, and the CSS custom property inherits into the shadow tree without first being declared on :host.

The current note can make it sound like a custom property has to be declared on :host before consumers can set it. This clarifies that :host provides a component default, while consumers can set the property on the host element without that declaration.
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@gunayanil is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant