This repository was archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
50 lines (46 loc) · 1.46 KB
/
index.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>TenoxUI Core</title>
<script src="./src/js/tenoxui.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("DOMContentLoaded", () => {
const props = {
bg: "background",
text: "color",
p: "padding",
br: "border-radius",
tr: "transition",
mt: "marginTop"
};
const selectors = document.querySelectorAll(
Object.keys(props)
.map(className => `[class*="${className}-"]`)
.join(", ")
);
selectors.forEach(selector => {
const styler = new makeTenoxUI({
element: selector,
property: props
});
selector.classList.forEach(className => {
// Remove responsive or pseudo-class prefixes
const prefix = className.replace(/^[a-z-]*:/, "").split("-")[0];
if (props[prefix]) {
styler.applyStyles(className);
console.log(className);
}
});
});
});
</script>
</head>
<body>
<h1 class="text-red hover:text-yellow p-1rem butterfly bg-blue hover:bg-#172081 hover:br-1rem tr-150ms ww-1rem">
Hello World
</h1>
</body>
</html>