0

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?

3

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:tokens>
  <aura:token name="Color1" value="#95ccff" />
</aura:tokens>

Then, in components that use the bundle:

.line { color: token(Color1) }

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

| improve this answer | |
  • +1yes right!... – salesforce-sas 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.