UNPKG

@cocreate/resize

Version:

A light weight resize handler make any element resizable by adding data attributes or usinng init object. Great for Customized text box or text area.

40 lines (36 loc) 620 B
div[resize] { position: absolute; display: block; } div[resize]:hover { background-color: rgba(0, 0, 0, 0.1); } div[resize='left'] { cursor: e-resize; width: 4px; left: 0px; top: 0; height: 100%; } div[resize='right'] { cursor: e-resize; width: 4px; right: 0px; top: 0; height: 100%; } div[resize='top'] { cursor: s-resize; height: 4px; width: 100%; top: 0px; left: 0; touch-action: auto; } div[resize='bottom'] { cursor: s-resize; height: 4px; width: 100%; bottom: 0px; left: 0; }