@badcss/core
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -33,8 +33,17 @@ import { ButtonComponent } from "./components/Button.js"; | ||
const config = body.getAttribute("themostbad"); | ||
// Check if the config is valid | ||
if (!config) { | ||
console.warn("No config found"); | ||
} | ||
const configObj = eval("(" + config + ")"); | ||
// Check if the config is valid | ||
if (!configObj) { | ||
console.warn("No config found JSON"); | ||
} | ||
// Allowed plugins | ||
const dataPlugins = { | ||
fontawesome: `<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/${ | ||
configObj.plugins.fontawesome.version || "6.4.0" | ||
configObj?.plugins?.fontawesome?.version || "6.4.0" | ||
}/css/all.min.css" />`, | ||
@@ -45,5 +54,5 @@ }; | ||
// Load the plugins | ||
if (configObj.plugins.fontawesome) { | ||
if (configObj?.plugins?.fontawesome) { | ||
document.head.innerHTML += configObj.plugins.fontawesome.kitId | ||
? `<script src="https://kit.fontawesome.com/${configObj.plugins.fontawesome.kitId}.js" crossorigin="anonymous"></script>` | ||
? `<script src="https://kit.fontawesome.com/${configObj?.plugins?.fontawesome?.kitId}.js" crossorigin="anonymous"></script>` | ||
: dataPlugins.fontawesome; | ||
@@ -50,0 +59,0 @@ } |
{ | ||
"name": "@badcss/core", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A lightweight and customizable framework designed to simplify web development and enhance the styling capabilities of your projects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8629
205