static createRule(selector, style) {
    if (contains(selector, '<')) {
      throw new Error(`Selector does not allow '<', got: ${selector}`);
    }

    // Remove strings.
    const selectorToCheck =
        selector.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g, '');

    // Check characters allowed in CSS3 selectors.
    if (!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=\\^$|]+$/.test(selectorToCheck)) {
      throw new Error(
          'Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=\\^$|] and ' +
          'strings, got: ' + selector);
    }

    // Check balanced () and [].
    if (!SafeStyleSheet.hasBalancedBrackets_(selectorToCheck)) {
      throw new Error(
          '() and [] in selector must be balanced, got: ' + selector);
    }

    if (!(style instanceof SafeStyle)) {
      style = SafeStyle.create(style);
    }
    const styleSheet =
        `${selector}{` + SafeStyle.unwrap(style).replace(/</g, '\\3C ') + '}';
    return SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(
        styleSheet);
  }
Creates a style sheet consisting of one selector and one style definition.
Use {@link SafeStyleSheet.concat} to create longer style sheets.
This function doesn't support @import, @media and similar constructs.
@param {string} selector CSS selector, e.g. '#id' or 'tag .class, #id'. We
    support CSS3 selectors: https://w3.org/TR/css3-selectors/#selectors.
@param {!SafeStyle.PropertyMap|!SafeStyle} style Style
    definition associated with the selector.
@return {!SafeStyleSheet}
@throws {!Error} If invalid selector is provided.
@deprecated Use `safevalues.safeStyleSheet` or `safevalues.safeStyleRule`
    instead.