#need help setting up starlight-plugin-icons
1 messages · Page 1 of 1 (latest)
@deft juniper ill send you mjs file in your dms
note: in my starlgiht there are like dozens of plugins and integrations
it may or may not be cause why it causes issues
okay
yea that can happen
funny enough it starts with favicon
alright, and what is the error exactly
when i put my current startlight({}) in the Icons({})
oh wait
i was missing :
@deft juniper sorry to bother
i had starlight({}) instead of starlight: ({})
i feel so stupid smh
btw one more question the uno.config.ts is in the src folder or content folder
just to be sure
oh lol
np
it should be the project root
uhm
so src in my case
its in the same folder as astro.config.mjs
yes next to the astro config, this is mine
yeah same
not sure what folder you have named src but it should work, only the unocss vscode extension checks it anyway to my knowledge
wait i dont have it in src
i have it in docs file
yeah all good
hmm
{
label: 'Guides',
items: [
{ icon: 'i-ph:rocket-launch-duotone', label: 'Intro', slug: 'guides/intro' },
],
},
does this follow same logic as default starlight?
i guess i have to single out every file
maybe
wdym
im trying to understand how to make it work lmao
its been awhile i saw starlight
and trying to figuring out what i even wrote XDD
weird
doesnt seem to work
{ icon: 'material-symbols-light:format-list-bulleted-rounded', slug: 'docs/getting-started/home', label: "Home" },
this should be correct
i installed
npm i -D @iconify-json/material-symbols-light
try adding color-red to something and see if it works
i wrote this page which can help debugging: https://docs.rettend.me/starlight-plugin-icons/help/troubleshooting/
to something is kinda vague
start by verifying that the safelist is correct
or if the icons have 0 width perhaps
or if unocss creates the icon classes in the output css
well that's just a quick check i usually use to verify that unocss works at all
simply this:
<p class="text-red">test</p>
Expected a closing tag for <p> (92:1-92:21) before the end of paragraph
seems it doesnt lmao
how to know wether its correct or not
hm maybe i should create a check command for this, since the setup can be complex
- safelist: you should see the icon added to the generated safelist
- unocss: you should see the generated css for the icon
but first get unocss to work at all, if text-red works, you can try using an icon directly on a page:
<span class="i-material-symbols-light:format-list-bulleted-rounded size-8" />
btw you need to prefix icon classes with i-
"i-material-icon-theme:document",
"i-material-icon-theme:go",
"i-material-icon-theme:javascript",
"i-material-icon-theme:json",
"i-material-icon-theme:python",
"i-material-icon-theme:ruby",
"i-material-icon-theme:rust",
"i-material-symbols-light:lists"
]
its there
where did you find that
nothing
works
well text-red doesnt
hm still a unocss config issue then
this should be correct right?
ðŸ˜
in src there are just mdx files and components
what now
@deft juniper i got some news
i moved uno.config.ts into src foldder and the text is red
but the icon is gone
uhm
im not joking
xd
I deleted uno.config.ts file and the text after restart is still red
maybe theres some bug in your package?
the plugin needs a uno config file at the root, where other configs are
i haven't tested what happens if the uno config is placed somewhere else, so there can be issues then
but unocss shouldn't stop working if you place its config there
seems it doesnt XD
and still works
ngl im going insane
also it looks like your plugin overrides https://github.com/HiDeoo/starlight-sidebar-topics
maybe thats the issue
hm yea
it looks like this plugin has its own sidebar override
so they are incompatible
not sure what to do in this case, i don't really know any solution
well tbh i know about one basically uhh
create new sidebar component
and basically combine it?
i did such thing one time with help of someone else for giscus
and other plugin
but im not enough expirienced
for that
exactly
good news is that plugin-icons' sidebar is not that complicated
from my other project
which is basically
from scratch
there supposed to be an icon which is invisible
wth
i had to copy Sidebar.astro and SidebarSublist.astro from starlight, but i simple changed the icon prop's type to string, and changed the icon to an unocss icon:{entry.attrs['data-icon'] && <span class:list={[entry.attrs['data-icon'], 'sidebar-icon']} />}
i had to copy Sidebar.astro and SidebarSublist.astro from starlight, but i simply changed the icon prop's type to string, and added an unocss icon:
{entry.attrs['data-icon'] && <span class:list={[entry.attrs['data-icon'], 'sidebar-icon']} />}