2019 CSS Wishlist
What do you wish CSS could do natively that it can’t do now? First, let’s review the last time we did this in 2013.
- ? “I’d like to be able to select an element based on if it contains another particular selector”
- ? “I’d like to be able to select an element based on the content it contains”
- ? “I’d like multiple pseudo elements”
- ? “I’d like to be able to animate/transition something to
height: auto;
“ - ? “I’d like things from Sass, like
@extend
,@mixin
, and nesting” - ? “I’d like
::nth-letter
,::nth-word
, etc” - ? “I’d like all the major browsers to auto-update”
Ouch. Oh well. I’m not sure how hotly requested all those actually are or how feasible it is to even implement them. They’re merely ideas that I thought we be useful in 2013, and as it turns out, I still do.
This time, instead of me making my own list, let’s have a gander around the internet at other people who have rounded up CSS desires.
TL;DR List
In observing several sources of conversation around things people desire in CSS, these seem like the most common asks:
- Parent queries. As in, selecting an element any-which-way, then selecting the parent of that element. We have some proof it’s possible with
:focus-within
. - Container queries. Select a particular element when the element itself is under certain conditions.
- Standardized styling of form elements.
- Has/Contains Selectors.
- Transitions to
auto
dimensions. - Fixed up handling of viewport units.
Notably, what’s interesting to me is the lack of people asking for style scoping. It came up a little, but not a ton. It seems like such a big part of the CSS-in-JS conversation, so I’m surprised to see so little mention of it in the context of general “what does CSS need?” conversations.
Jen Simmons asked what’s on our lists
Making a wish list of all the things I’d love to see happen in the world of CSS in 2019. What’s on your list? Things you want to learn? Problems you want help solving? New properties you need? Design ideas you wish you could code? Resources you’d love to have? Name your desire.
— Jen Simmons (@jensimmons) November 14, 2018
Notable replies from the thread:
- Aspect ratios (it’s weirdly tricky in CSS, coming to HTML probably, and maybe we’ll get it natively in CSS with a property someday)
- Exclusions
- Regions
- Subgrid (it’s coming!)
text-wrap: avoid-widows-and-orphans
- Nesting
- Outline with radius
- Animated background gradients (without faking it by moving them or whatever else)
text-overflow:ellipsis over multiple lines / line clamping
- 0-to-auto transitions
- Parent selectors
- Async
@import
- Math functions like
sqrt()
,sin()
andcos()
font-min-size
andfont-max-size
- Masonry
Tab Atkins wanted to know what parts of CSS give us the most trouble
What parts of CSS give you the most trouble due to browser behavior differences? Collecting some data, please RT. (If answer is different for mobile vs desktop, let me know.)
— ?Taudry Hepburn? (@tabatkins) October 3, 2018
Notable replies from the thread:
- Tons and tons of requests for a standardized way to style form elements — not just for styling desire, but for accessibility to prevent trading standards for styling.
- Being able to test browser support of more than just property/values with
@supports
- Improved handling of viewport units and their relationship to other browser UI
- Improved handling of multi-column layout handling
- Elastic scrolling
Tommy Hodgins did a CSS+JS advent calendar on Twitter that documents interesting possibilities
Dec 1: Parent Selector ?? Though CSS doesn't have a :parent selector, you can create your own with a small JavaScript function and use a selector like [--parent] in your CSS stylesheets today!
demo: https://t.co/9N1A1Un8XT
code: https://t.co/NNUuvOi1zH#css #javascript pic.twitter.com/Nv8V3rl2AF— Tommy Hodgins (@innovati) December 1, 2018
Tommy's list:
- Parent selector
- Has selector
- Closest selector
- First in document (like how
querySelector
works) - Elder sibling selector
- Previous sibling selector
- Contains selector
- Regex selector
- Computed style selector
:nth-letter
/:nth-word
- Media pseudo selectors
- Not-blank valid/invalid selector
- Element queries
- Attribute comparison selectors
- Custom specificity
- Visibility selectors
- Overflow detection selector
- User agent detection selector
- Storage queries
- Date queries
- Protocol queries
- Deep hover
We asked as well
Putting together a list of most-wanted native CSS features. There are lots of ideas out there!
Hit me with quick hit ideas. Don't think too hard.
— CSS-Tricks (@css) December 17, 2018
Notable replies from the thread:
- Container queries
- Has selector
- Regions
- Color modification functions
- Nesting
- Shaders
- Transition to
auto
dimensions / transition fromdisplay: none;
- Previous sibling selector
font-size: fit;
- Styling
grid-template-areas
- Animation between
grid-template-areas
- Types for custom properties
clip-path
accepting pathsinline-styles: ignore;
- Aspect ratios
- Scoping
// single line comments
- Corner shapes
The post 2019 CSS Wishlist appeared first on CSS-Tricks.