Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, I mean if your entire codebase is written this way, adding a breakpoint somewhere in the middle of the pack now requires editing every rule that uses this shorthand otherwise the values after the corresponding breakpoint will apply to the wrong breakpoints.

    /* before */
    width: 10px | 20px | 30px | 40px | 50px

    /* after */
    @media (min-width: 360px) { /* here I added a new smallest breakpoint somewhere */ }
    /* ...elsewhere in the stylesheet */
    width: 5px | 10px | 20px | 30px | 40px | 50px
    /*     ^ every rule using the shorthand now needs a new value at this slot */
    /* if you forget to align the slots, you will break every existing layout */
    /* code written the normal way does not suffer from this regression */



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: