News for hackers. Stuff that matters.
Re:CSS Reminification: A crazy idea that worked by ht85 on Wednesday March 08, 2017 @08:46PM (#13826075)
Maybe I'm misunderstanding your example, are you trying to emulate `.nth-child(x)` with classes like `.list-1`, `.list-2`?

If that's the case, using CSS Modules, you can do in CSS:

    .list-1 { ... }
    .list-2 { ... }
requiring it will yield a map like this:

    { 'list-1': 'JSNF4S12', 'list-2': 'IE945JSN' }
which you can use this way:

    const styles = require('file.css');
    $('.' + styles[`list-${i}`])
    // effectively $('.JSNF4S12')

There are no comments on this comment yet.