From 8a3e0f175c1f63cebc30d8b09ad79aa5b71c30aa Mon Sep 17 00:00:00 2001 From: Ahmed Rangel <ahmedrangel@outlook.com> Date: Sat, 12 Apr 2025 20:28:32 -0500 Subject: [PATCH 1/3] feat: add bootstrap detector --- detectors/uis.json | 15 +++++++++++++++ icons/ui/getbootstrap.svg | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 icons/ui/getbootstrap.svg diff --git a/detectors/uis.json b/detectors/uis.json index 246b0c1..b697b25 100644 --- a/detectors/uis.json +++ b/detectors/uis.json @@ -179,5 +179,20 @@ "detectors": { "html": "<(?:div|button|a) [^>]*class=\"arco-[a-z0-9-]*" } + }, + "bootstrap": { + "metas": { + "slug": "bootstrap", + "name": "Bootstrap", + "imgPath": "/ui/getbootstrap.svg", + "url": "https://getbootstrap.com" + }, + "detectors": { + "html": [ + "<link [^>]*href=\"[^\"]+bootstrap(?:\\.min)?\\.css", + "<script [^>]*src=\"[^\"]+bootstrap.min\\.js" + ], + "js": "[...document.styleSheets].map(s => [...s.cssRules].some(r => r.selectorText?.includes(':root') && r.cssText.includes('--bs-'))).some(v => v)" + } } } diff --git a/icons/ui/getbootstrap.svg b/icons/ui/getbootstrap.svg new file mode 100644 index 0000000..9839049 --- /dev/null +++ b/icons/ui/getbootstrap.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 118 94"> + <path fill="#712cf9" fill-rule="evenodd" d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 0 1-2-2V24a2 2 0 0 1 2-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863M60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207M49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281s-3.903-8.178-11.425-8.178H49.948z" clip-rule="evenodd"></path> +</svg> From 87ea8fd3c98d61e4d3f71b51a830585706ed2577 Mon Sep 17 00:00:00 2001 From: Ahmed Rangel <ahmedrangel@outlook.com> Date: Sat, 12 Apr 2025 20:30:29 -0500 Subject: [PATCH 2/3] chore: update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 41dbd29..9446d48 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ To support a new Vue framework, please look at [detectors/frameworks.json](detec - [Vue Material](https://www.creative-tim.com/vuematerial) - [Vulk](https://vulk.cssninja.io) - [Arco Design](https://arco.design) +- [Bootstrap](https://getbootstrap.com) To support a new UI library, please look at [detectors/uis.json](detectors/uis.json). From 0264e97d11d1efdaf2cbe23b4d20e91c1a357231 Mon Sep 17 00:00:00 2001 From: Ahmed Rangel <ahmedrangel@outlook.com> Date: Tue, 22 Apr 2025 08:53:07 -0500 Subject: [PATCH 3/3] fix(bootstrap): js detector --- detectors/uis.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detectors/uis.json b/detectors/uis.json index b697b25..199432a 100644 --- a/detectors/uis.json +++ b/detectors/uis.json @@ -192,7 +192,7 @@ "<link [^>]*href=\"[^\"]+bootstrap(?:\\.min)?\\.css", "<script [^>]*src=\"[^\"]+bootstrap.min\\.js" ], - "js": "[...document.styleSheets].map(s => [...s.cssRules].some(r => r.selectorText?.includes(':root') && r.cssText.includes('--bs-'))).some(v => v)" + "js": "[...document.styleSheets].filter(s => !s.href || s.href.includes(location.origin)).map(s => [...s.cssRules].some(r => r.selectorText?.includes(':root') && r.cssText.includes('--bs-'))).some(v => v)" } } }