I need to use css costomproperties in lightning Aura component like so

:colors{--Color1:color: #95ccff;} .line{color:var(--Color1);}

I tried to use it in 'STYLE' at component bundle, but I got error.

Is it possible to use costomproperties in Aura?

1 Answer 1


In Aura, we use Tokens instead. First, you create a Token Bundle, then you use the token function to access those values. For example, you would define a token bundle:

  <aura:token name="Color1" value="#95ccff" />

Then, in components that use the bundle:

.line { color: token(Color1) }

CSS custom properties, the standard, is not supported in Aura Components.

  • +1yes right!... Aug 30, 2019 at 4:07
  • I succseeded. Thx a lot,
    – Hayato
    Aug 30, 2019 at 5:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .