Hacker News new | past | comments | ask | show | jobs | submit login

No reason why Webpack/`import css` couldn't eliminate the CSS from this

    // styles.css
    .root { background: grey; }
    .button { border: 1px solid blue; }
    .error { color: red }
    .alert { background: red }

    // Component.css
    import styles from './styles.css'

    return (
      <div className={styles.root}>
        <button className={styles.button}>Submit</button>
        {false && <div className={styles.error}>Error!</div>}
      </div>
    )
Both the .error and .alert are candidates for being removed.

Of course, I'm not aware of any solution for nothing this currently, but all the bits and pieces are there for it to be feasible.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: