Insert a css to css list

@since   1.1
@param   int $index Index of insert position
@param   string $type Type of css (file, library or css)
@param   string $hrefOrCss Path of css from /public or css content.
@return  $this
170802
private function insert($index, $type, $hrefOrCss)
    {
        self::$cssList->insert($index, array($type, $hrefOrCss));
        return $this;
    }
1303197
public function injectIndex(Index $index)
    {
        foreach ($this->_indexes as $_index) {
            if ($_index->getId() === $index->getId()) {
                return;
            }
        }
        $this->_indexes[] = $index;
    }
1020323
protected function injectCSS() {
            if (!$this->isCLI && !self::$cssInjected) {
                self::$cssInjected = true;
                if (file_exists($this->config->cssPath)) {
                    echo '<style type="text/css">';
                    /** @noinspection PhpIncludeInspection */
                    include $this->config->cssPath;
                    echo '</style>';
                } else {
                    echo 'The AloFramework handlers\' CSS file could not be found: ' . $this->config->cssPath . PHP_EOL;
                }
            }
        }
1029765
function insertCss(styles, { replace = false, prepend = false, prefix = 's' } = {}) {
  const ids = []
  for (let i = 0; i < styles.length; i++) {
    const [moduleId, css, media, sourceMap] = styles[i]
    const id = `${prefix}${moduleId}-${i}`

    ids.push(id)

    if (inserted[id]) {
      if (!replace) {
        inserted[id]++
        continue
      }
    }

    inserted[id] = 1

    let elem = document.getElementById(id)
    let create = false

    if (!elem) {
      create = true

      elem = document.createElement('style')
      elem.setAttribute('type', 'text/css')
      elem.id = id

      if (media) {
        elem.setAttribute('media', media)
      }
    }

    let cssText = css
    if (sourceMap && typeof btoa === 'function') {
      // skip IE9 and below, see http://caniuse.com/atob-btoa
      cssText += `\n/*# sourceMappingURL=data:application/json;base64,${b64EncodeUnicode(
        JSON.stringify(sourceMap),
      )}*/`
      cssText += `\n/*# sourceURL=${sourceMap.file}?${id}*/`
    }

    if ('textContent' in elem) {
      elem.textContent = cssText
    } else {
      elem.styleSheet.cssText = cssText
    }

    if (create) {
      if (prepend) {
        document.head.insertBefore(elem, document.head.childNodes[0])
      } else {
        document.head.appendChild(elem)
      }
    }
  }

  return removeCss.bind(null, ids)
}
290631
public function insert($index, $value)
    {
        $this->checkType($value);

        return parent::insert($index, $value);
    }
541860
protected function _getToken($index, $type)
    {
        if ($index === null) {
            $index = $this->_current;
        }
        return isset($this->_data[$index]) ? $this->_data[$index][$type] : null;
    }
1047903
public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){
		$this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback));
		return $this;
	}
728954
public function remove($type, $index = null)
    {
        if ($index === null) {
            unset($this[$type]);
            return;
        }

        if(!isset($this[$type][$index])) {
            throw new NoSuchElementException("There is no rule '$type' type indexed by '$index'.");
        }

        unset($this[$type][$index]);
    }
1170273
public function setIcon($href, $type = 'png')
    {
        switch ($type) {
            case 'png':
                $this->icon = $this->createLink([
                    'rel'  => 'icon',
                    'type' => 'image/png',
                    'href' => $href
                ]);
                break;
            case 'ico':
                $this->icon = $this->createLink([
                    'rel'  => 'shortcut icon',
                    'type' => 'image/x-icon',
                    'href' => $href
                ]);
                break;
            default:
                $this->icon = '';
                break;
        }
    }
443845
public function addLink($href, $type = 'text/css', $rel = 'stylesheet', $media = 'screen')
    {
        $this->parts[] = '<link href="'.$href.'" media="'.$media.'" rel="'.$rel.'" type="'.$type.'" />';

        return $this;
    }
840776
public function insertAtIndex(ResourceNode $node, $index)
    {
        //throw new \Exception($index);
        $this->om->startFlushSuite();

        if ($index > $node->getIndex()) {
            $this->shiftLeftAt($node->getParent(), $index);
            $node->setIndex($index);
        } else {
            $this->shiftRightAt($node->getParent(), $index);
            $node->setIndex($index);
        }

        $this->om->persist($node);
        $this->om->forceFlush();
        $this->reorder($node->getParent());
        $this->om->endFlushSuite();
    }
477305
public function link($type = null, $index = null)
    {
        // One-time caching of link elements
        if ($this->links === null) {
            $this->cacheLinkTypeItems();
        }

        // Find the matching LinkType items
        $links = ($type === null) ? $this->links->getItems() : $this->links->getItems($type);

        // Return link item(s)
        return ($index === null) ? new ItemList($links) : $this->getLinkIndex($links, $type, $index);
    }
919347
public function addRenderer($index, $method = null)
    {
        $this->renderers[$index] = is_null($method) ?  $index : $method;
        return $this;
    }
3141
public function addChild($index) {
		foreach($this->children as $child) {
			if($child->getID() == $index) return;
		}
		$this->children[] = $this->reflector->getBlockByID($index);
	}
29810
public function setByType($type)
    {
        if (isset(self::$sourceList[$type])) {
            $this->value = self::$sourceList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }
274476
public function addIndex(Index $index)
    {
        if ($this->hasIndex($index->getName())) {
            throw SchemaException::tableIndexAlreadyExists($this->getName(), $index->getName());
        }

        foreach ($index->getColumnNames() as $columnName) {
            if (!$this->hasColumn($columnName)) {
                throw SchemaException::tableColumnDoesNotExist($this->getName(), $columnName);
            }
        }

        foreach ($this->getIndexes() as $indexCandidate) {
            if ($indexCandidate->isBetterThan($index)) {
                return;
            }
        }

        foreach ($this->getIndexes() as $indexCandidate) {
            if ($index->isBetterThan($indexCandidate)) {
                $this->dropIndex($indexCandidate->getName());
            }
        }

        $this->indexes[$index->getName()] = $index;
    }
201741
private function applyAttribs(Tokens $tokens, $index, array $attribs)
    {
        $toInsert = [];

        foreach ($attribs as $attrib) {
            if (null !== $attrib && '' !== $attrib->getContent()) {
                $toInsert[] = $attrib;
                $toInsert[] = new Token([T_WHITESPACE, ' ']);
            }
        }

        if (!empty($toInsert)) {
            $tokens->insertAt($index, $toInsert);
        }
    }