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?


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 '19 at 4:07
  • I succseeded. Thx a lot,
    – Hayato
    Aug 30 '19 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.