I am new to SCSS. I have looked around in many places to find a solution but couldn’t.
I am developing an app that displays a list of phones. I get this list (in the form of JSON array) by calling a REST API. All the phones has same type of information to be displayed, like Name, Model, Price, Available, Quantity.
What I am trying to do is:
- Display these phones in their own Card () with individual colors depending on the type of the phone. The “Phone Type” is an integer value.
- Display Name, Price, Available and Quantity in different font sizes. That is, Name of phone in all cards will be displayed in a similar way. Same for Price, Availability and Quantity.
I have read about @mixin in SCSS and that they can accept parameters. I guess I can use this to pass in my phone type integer/number value.
All the examples I have seen are calling @mixin from a another SCSS file by passing in the parameter value. So I am a bit confused.
Is this the only way to pass in parameter value(s) to a @mixin?
It would be great if somebody can please tell me if there is a way to pass parameter value (the phone type in my case) from HTML to SCSS @mixin.
Any help is highly appreciated.