-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (22 loc) · 854 Bytes
/
index.js
File metadata and controls
25 lines (22 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import * as cssom from './lib/cssom/index.js'
/**
* @param {Window} globalObject
*/
function install(globalObject = globalThis) {
const entries = Object.entries(cssom)
while (0 < entries.length) {
const entry = entries.pop()
const [, wrapper] = entry
const { inheritance } = wrapper
if (inheritance && entries.find(entry => entry[0] === inheritance)) {
entries.unshift(entry)
continue
}
wrapper.install(globalObject, ['Window'])
}
globalObject.CSS = cssom.CSS.create(globalObject)
}
export { CSSStyleProperties, CSSStyleSheet, StyleSheetList } from './lib/cssom/index.js'
export { matchElementAgainstSelectors, matchTreesAgainstSelectors } from './lib/match/selector.js'
export { parseGrammar, parseListGrammar } from './lib/parse/parser.js'
export { install }