Just a heads up: This solution is specifically for WebKit browsers, as attempts with other browsers and their named versions didn't yield successful results.
Code:
If you have an element styled like this in your CSS:
.styled {
resize:both;
overflow:auto;
background:orange; /* just for looks */
}
You can customize the handle by adding WebKit's specific pseudo-selector ::-webkit-resizer
:
::-webkit-resizer {
border: 2px solid yellow;
background: blue;
box-shadow: 0 0 2px 5px red;
outline: 2px dashed green;
/*size does not work*/
display:block;
width: 150px !important;
height: 150px !important;
}
Visual:
http://jsfiddle.net/RaphaelDDL/ryphs/1/
Final thoughts
I tried using ::-moz-resizer
on FF22, but it didn't function properly. Therefore, resorting to creating a JavaScript alternative similar to StackOverflow's textarea handle might be necessary.
Extra info
When styling shadow DOM pseudo selectors, avoid combining them into one selector like
::-webkit-resizer, ::-moz-resizer { /*css*/}
, as it will invalidate the entire selection.
- Here is a reference list of Shadow DOM selectors: https://gist.github.com/afabbro/3759334
- For more information on Shadow DOM (HTML5Rocks), check here and here.
- A visually appealing and well-organized list of shadow DOM selectors along with screenshots can be found here
- Check out the list of Mozilla's selectors (no pseudo-selector for resizer) here