Properly render theme icon when using a studio layer as theme

This commit is contained in:
Pieter Vander Vennet 2024-06-19 01:56:19 +02:00
parent 5ead6c6e37
commit d38a6c7505
6 changed files with 50 additions and 27 deletions

View file

@ -5,11 +5,30 @@
/**
* Renders a 'marker', which consists of multiple 'icons'
*/
export let icons: { icon: string; color: string }[]
export let icons: string | { icon: string; color: string }[]
if(typeof icons === "string") {
icons = icons.split(";").map(subspec => {
if(subspec.startsWith("http://") || subspec.startsWith("https://")){
return {
icon: subspec, color: "black"
}
}
const [icon, color] = subspec.split(":")
return {
icon, color: color ?? "black"
}
})
}
/**
* Class which is applied onto the individual icons
*/
export let clss = ""
/**
* Class applied onto the entire element
*/
export let size = "w-full h-full"
</script>