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

Dear lord it's 2020 CSS has its own grid system, it's CSS Grid, and it's both easier to understand and more flexible than adopting the old frameworks. It also has variables, pseudo-selectors (which, like with html elements, you can invent new ones to suit your purposes), and more.


Is creating your own pseudo-selectors really possible? I like to think I'm pretty up to date on modern CSS but I've never heard of this.


I might be wrong but I think GP is talking about shadow parts[1]

    my-element::part(custom-selector) {
      /* ... */
    }
1: https://developer.mozilla.org/en-US/docs/Web/CSS/::part


Well, I wouldn't recommend it, but certainly you can programmatically apply a pseudo-element or pseudo-class and programmatically define behavior around those things.




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

Search: