Skip to content

Instantly share code, notes, and snippets.

View nhensh's full-sized avatar

Nathan Hensher nhensh

View GitHub Profile
.font(@family, @size, @weight, @lineHeight, @letterSpacing){
font-family: @family;
font-size:@size;
font-weight:@weight;
line-height:@lineHeight; /* inherit */
letter-spacing:@letterSpacing; /* inherit */
}
@nhensh
nhensh / currencyInputMask
Last active February 21, 2018 09:27
Currency Input Mask
const getDigitsFromValue = (value = '') => value.replace(/(-(?!\d))|[^0-9|-]/g, '') || ''
const padDigits = digits => {
const desiredLength = 3
const actualLength = digits.length
if (actualLength >= desiredLength) {
return digits
}