Currently, I am reviewing some code that utilizes the npm utility classnames found at https://www.npmjs.com/package/classnames.
Within the scss file, there are various classes with identical names (small and large), as shown below:
.buttonA {
&.small {
height: 50px;
}
&.large {
height: 80px;
}
}
.buttonB {
&.small {
height: 20px;
}
&.large {
height: 40px;
}
}
This portion of the code is from the tsx file:
<IconButton
....
className={
classNames('buttonA', 'small')
}
/>
I find this setup quite perplexing as it's unclear which 'small' class will be applied, given that we have two in the scss file. My assumption is that it would prioritize the 'small' class from buttonA since it's specified as the first parameter. However, I'm left wondering if these parameters are interdependent. What happens if I use classNames('buttonB', 'small'), or even just classNames('small')?