dist/bbn.js
/**
     * Returns true if the given value is a valid CSS dimension string, false otherwise.
     *
     * @method   isValidDimension
     * @global
     * @memberof bbn.fn
     * @param    {String} st
     * @returns
     */
Returns true if the given value is a valid CSS dimension string, false otherwise.
Returns true if the given value is a valid CSS dimension string false otherwise .
isValidDimension(st) {
      if ( (typeof(st) === 'string') &&
        (st.length > 0) && (
          (st.indexOf('calc') === 0 ) ||
          (!isNaN(bbn.fn.substr(st, 0,1))) ) ){
        let el = document.createElement('div');
        el.style.width = st;
        let res = !!el.style.width.length;
        el.remove();
        return res;
      }
      return false;
    }
isValidDimension ( st ) { if ( ( typeof ( st ) === 'string' ) && ( st . length > 0 ) && ( ( st . indexOf ( 'calc' ) === 0 ) || ( ! isNaN ( bbn . fn . substr ( st , 0 , 1 ) ) ) ) ) { let el = document . createElement ( 'div' ) ; el . style . width = st ; let res = ! ! el . style . width . length ; el . remove ( ) ; return res ; } return false ; }
Returns true if the given value is a valid CSS dimension string, false otherwise.
Returns true if the given value is a valid CSS dimension string false otherwise .