Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (26 sloc) 1.07 KB
layout title menuOrder
page
Update Image Size
10

Many web-developers forget to write width and height attributes for <img> tags which leads to poor UX. This action helps you to automate this process: simply place caret inside <img> tag and run this action to add/update width and height attributes.

In CSS, place caret inside property value with url() function to add/update width and height properties for current rule.

<textarea class="movie-def"> |<img src="demo.jpg" alt="" /> <style> .block { background: url(demo.jpg); } </style> ~~~ tooltip: Put caret inside <img> tag and run “Update Image Size” to get its size moveTo: 6 wait: 1000 run: emmet.update_image_size ::: “Update Image Size” (Shift-Cmd-U) wait: 1000 tooltip: Put caret inside value with image URL to update width and height properties of the rule moveTo: 3:22 wait: 1000 run: emmet.update_image_size </textarea>

Note that this action also works for absolute URLs: it will start searching for requested file from host file’s folder and then will traverse up the tree.