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.
7 Essential JavaScript Functions
I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like
addEventListener
andattachEvent
. Times have changed but there are still a few functions each developer should…
Using MooTools For Opacity
Although it’s possible to achieve opacity using CSS, the hacks involved aren’t pretty. If you’re using the MooTools JavaScript library, opacity is as easy as using an element’s “set” method. The following MooTools snippet takes every image with the “opacity” class and sets…
jQuery Wookmark
The first thing that hits you when you visit Pinterest is “Whoa, the columns are the same width and the photos are cut to fit just the way they should.” Basic web users probably think nothing of it but as a developer, I can appreciate the…
Source link