DISCUSS: If there's one CSS feature you could add, what would it be?
Thalita G.

Thalita G. @thalitadev

About: A fullstack webdeveloper who wants to share her experiences with the net.

Joined:
Mar 16, 2021

DISCUSS: If there's one CSS feature you could add, what would it be?

Publish Date: Apr 15 '21
4 10

CSS has gone a very long way from being a simple stylesheet to something more dynamic. Think of calc() and CSS variables. They haven't turned CSS into a programming language, but they sure are helpful!

But there's still a lot that could be added to CSS! Now, imagine you were a wizard who possesses the entire W3 team and whoever works on our browsers... 🧙‍♂️✨

✍ Comment below answering the following question

If there was one CSS feature you could add that gets instantly supported by all major browsers, what would it be?

This can be a new feature or something that's already in W3 but isn't supported yet. It also doesn't have to be a property, you can think about functions as well. The possibilities are endless!


Thalita logo

Twitter | Website

Comments 10 total

  •  🐤🥇 Jasper de Jager
    🐤🥇 Jasper de JagerApr 15, 2021

    A parent selector

    .myClass < span { display: block }

    • Thalita G.
      Thalita G.Apr 15, 2021

      Gosh, the many situations where I wished there was a parent selector! 🙃

    • Temani Afif
      Temani AfifApr 15, 2021

      it does exist: drafts.csswg.org/selectors-4/#rela... but we still need to wait too long for a tiny support

      • Nicholas Stimpson
        Nicholas StimpsonApr 15, 2021

        The problem with a has() selector, according to Tab Atkins, is that means that any DOM mutation will cause the cascade for the entire document to have to be rebuilt, which is much too slow. There's some suggestions that a has-child() selector might be possible, but it still increases the sub-tree that needs its cascade rebuilt from everything under the mutated element's parent, to everything under the mutated element's grandparent, which may still be regarded as too great. So don't hold your breath waiting for support.

  • Nicholas Stimpson
    Nicholas StimpsonApr 15, 2021
    1. attr() on all properties and on regular elements would be great.
    2. There was some great ideas in the 2003 Generated and Replaced Content draft, like ::outside pseudo element, ::before::before::before etc pseudo elements, deferring rendering with an ::alternate pseudo element. Wish we had those.
    3. If we can't have 2, then content:contents would be very helpful.
    4. CSS regions
    5. CSS exclusions.

    Oops, that's five features. Just being greedy :-)

    • Thalita G.
      Thalita G.Apr 15, 2021

      Getting attr() on all properties would be absolutely great! If I had to pick one of these, it'd be most definitely that one! :)

  • Thalita G.
    Thalita G.Apr 15, 2021

    Hmm, that's a very interesting one! 😮☝ Not sure about using Js in CSS, but CSS could use some kinda programming logic, like what Sass has!

Add comment