News for hackers. Stuff that matters.
Re:CSSnano by sionisrecur on Monday September 16, 2024 @12:15PM (#41557615)
At least regarding tailwindcss, it checks your code to filter out unused css classes. So it is recommended to have full class names in the code instead of constructing them by concatenating strings. So if you have a variable `buttonColor` that can be `red` or `blue` it is better to do something like

    switch(buttonColor) {
        'red': return 'button-red';
        'blue': return 'button-blue';
    }
over

    return 'button-' + buttonColor;

There are no comments on this comment yet.