Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 798 Bytes

css.md

File metadata and controls

32 lines (28 loc) · 798 Bytes

css

预加载css

Installation

可以用ES6 模块的形式引入

import {cssLoad} from 'preload';

也可以直接使用CommonJS方式引入

var cssLoad= require('cssLoad');

或者直接引入到HTML里面也可以

<script src="https://unpkg.com/[email protected]/dist/iife/cssLoad.js"></script>

usage

最简形式使用

	<h1 class="index" id="index">index.css样式表插入</h1>
    <h1 class="main" id="main">main.css样式表插入</h1>
	cssLoad('./style/index.css', document.getElementById("index"), "all");
    cssLoad('./style/main.css', document.getElementById("main"), "all");

change log

2.1.2
2.0.1