5

The Lightning [developer guide][1] is not very helpful on how to use Design tokens:

Tokens created in the defaultTokens bundle are automatically available in components in your namespace.

Ok, and what if I want to rename it or if another one is already using it? How would I then access them different from:

.THIS p {
    font-family: token(myBodyTextFontFace);
    font-weight: token(myBodyTextFontWeight);
}
1
  • Documentation doesn't say if we can create another token file. I think we cannot have more than one token file. Hope i am proved wrong
    – RedDevil
    Commented Jun 18, 2018 at 14:22

1 Answer 1

3

You can create custom tokens, but you cannot reference your custom tokens directly in your lightning component. If you want to create custom token other than Default token then you need to maintain a hierarchical structure of other tokens. Default token will be the parent and all others child and sub-child and so on. To extend Tokens in the parent token use the keyword “extends”.

I would suggest you look into the below link for more info on how to use custom tokens.

Use Tokens in salesforce Lightning

0

You must log in to answer this question.

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