apis/nucleus/dist/nucleus.dev.js
/**
   * Converts a Rule to CSS string.
   */
Converts a Rule to CSS string.
Converts a Rule to CSS string .
function toCss(selector, style, options) {
    if (options === void 0) {
      options = {};
    }
    var result = '';
    if (!style) return result;
    var _options = options,
        _options$indent = _options.indent,
        indent = _options$indent === void 0 ? 0 : _options$indent;
    var fallbacks = style.fallbacks;
    if (selector) indent++; 
    if (fallbacks) {
      if (Array.isArray(fallbacks)) {
        for (var index = 0; index < fallbacks.length; index++) {
          var fallback = fallbacks[index];
          for (var prop in fallback) {
            var value = fallback[prop];
            if (value != null) {
              if (result) result += '\n';
              result += "" + indentStr(prop + ": " + toCssValue(value) + ";", indent);
            }
          }
        }
      } else {
        for (var _prop in fallbacks) {
          var _value = fallbacks[_prop];
          if (_value != null) {
            if (result) result += '\n';
            result += "" + indentStr(_prop + ": " + toCssValue(_value) + ";", indent);
          }
        }
      }
    }
    for (var _prop2 in style) {
      var _value2 = style[_prop2];
      if (_value2 != null && _prop2 !== 'fallbacks') {
        if (result) result += '\n';
        result += "" + indentStr(_prop2 + ": " + toCssValue(_value2) + ";", indent);
      }
    } 
    if (!result && !options.allowEmpty) return result; 
    if (!selector) return result;
    indent--;
    if (result) result = "\n" + result + "\n";
    return indentStr(selector + " {" + result, indent) + indentStr('}', indent);
  }
function toCss ( selector , style , options ) { if ( options === void 0 ) { options = { } ; } var result = '' ; if ( ! style ) return result ; var _options = options , _options$indent = _options . indent , indent = _options$indent === void 0 ? 0 : _options$indent ; var fallbacks = style . fallbacks ; if ( selector ) indent ++ ; if ( fallbacks ) { if ( Array . isArray ( fallbacks ) ) { for ( var index = 0 ; index < fallbacks . length ; index ++ ) { var fallback = fallbacks [ index ] ; for ( var prop in fallback ) { var value = fallback [ prop ] ; if ( value != null ) { if ( result ) result += '\n' ; result += "" + indentStr ( prop + ": " + toCssValue ( value ) + ";" , indent ) ; } } } } else { for ( var _prop in fallbacks ) { var _value = fallbacks [ _prop ] ; if ( _value != null ) { if ( result ) result += '\n' ; result += "" + indentStr ( _prop + ": " + toCssValue ( _value ) + ";" , indent ) ; } } } } for ( var _prop2 in style ) { var _value2 = style [ _prop2 ] ; if ( _value2 != null && _prop2 !== 'fallbacks' ) { if ( result ) result += '\n' ; result += "" + indentStr ( _prop2 + ": " + toCssValue ( _value2 ) + ";" , indent ) ; } } if ( ! result && ! options . allowEmpty ) return result ; if ( ! selector ) return result ; indent -- ; if ( result ) result = "\n" + result + "\n" ; return indentStr ( selector + " {" + result , indent ) + indentStr ( '}' , indent ) ; }
Converts a Rule to CSS string.
Converts a Rule to CSS string .
// Apply fallbacks first. // Array syntax {fallbacks: [{prop: value}]} // Object syntax {fallbacks: {prop: value}} // Allow empty style in this case, because properties will be added dynamically. // When rule is being stringified before selector was defined.