Option to make CSS-selector-friendly ids?
JoshMcCullough opened this issue · comments
Josh McCullough commented
CSS selectors cannot start with a number, so shortid
will generate non-compliant ids if you are using it to generate ids for HTML elements, which are later referenced from CSS.
It'd be nice to have a global option we can configure to ensure that generated ids do not start with a number. Though this is easily worked around by wrapping shortid
:
import _shortid from 'shortid';
export const shortid = () => `_${_shortid}`;
Just something to consider.
Josh McCullough commented
Switching to nanoid
due to deprecation.