As the demands of the web change and developers experiment with different user experiences, the need for more native language improvements expands. Our presentation layer, CSS, has done incredibly well in improving capabilities, even if sometimes too slow. The need for native support for automatically expanding textarea
elements has been long known…and it’s finally here!
To allow textarea
elements to grow vertically and horizontally, add the field-sizing
property with a value of content
:
textarea { field-sizing: content; // default is `fixed` }
The default value for field-sizing
is fixed
, signaling current behavior. The new behavior, content
, will expand as much as possible. To constrain the size a textarea
can grow, use traditional width/max-width
and height/max-height
properties.
I’m an Impostor
This is the hardest thing I’ve ever had to write, much less admit to myself. I’ve written resignation letters from jobs I’ve loved, I’ve ended relationships, I’ve failed at a host of tasks, and let myself down in my life. All of those feelings were very…
CSS @supports
Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn’t been available within CSS. What we end up doing is repeating the same properties multiple times with each browser prefix. Yuck. Another thing we…
Vertically Centering with Flexbox
Vertically centering sibling child contents is a task we’ve long needed on the web but has always seemed way more difficult than it should be. We initially used tables to accomplish the task, then moved on to CSS and JavaScript tricks because table layout was horribly…
Source link