pateketrueke / yrv

Your routing vibes! (for Svelte)
https://svelte.dev/repl/0f07c6134b16432591a9a3a0095a80de
161 stars 9 forks source link

How do we style Links (or the 'a' elements generated from them)? #48

Open mikemaccana opened 4 years ago

mikemaccana commented 4 years ago

Heya!

yrv works great, thank you! One quick question - how do I style a link? For example, I have:

<Link href="/{work.slug}" class="link">

which becomes:

<a href="/boomsaas" class="link" title="">

But if I try and style using a class "link" svelte complains the selector is unused:

Error: css-unused-selector

.link {
    width: 100%;
  }

How can I style a Link/a element?

Thanks! 😃

pateketrueke commented 4 years ago

Dang, you could use the :global(.link) syntax — I know is not so cool, but due how scoping works there's no other way to get rid of that warning.