How do I apply scoped styles to 'a' tag generated by Link?
See original GitHub issueI’ve got a Nav
component:
<script>
import {Link} from 'svelte-routing';
</script>
<style>
a {
color: #bedead;
text-decoration: underline;
}
</style>
<nav>
<a href="somewhere">Get me somewhere</a>
<Link to="/signin">Sign in</Link>
<Link to="/signup">Sign Up</Link>
</nav>
Is there any way to make scoped a
styles to be applied to anchors generated by Link
component?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Scoped CSS - Vue Loader
Scoped CSS. When a <style> tag has the scoped attribute, its CSS will apply to elements of the current component only. This is...
Read more >Vue.js: How can I make dynamically created HTML use ...
Dynamically Generated Content DOM content created with v-html are not affected by scoped styles, but you can still style them using deep ...
Read more >Scope of the <link> tag (specifically the scope of CSS style ...
I have a suggestion to the way that CSS style sheets are linked in ... script file in using <script> that it is...
Read more >Saving the Day with Scoped CSS
Scoped CSS has the ability to save the day, but if it's at all possible you should use ID selectors and linked stylesheets....
Read more >scope - CSS: Cascading Style Sheets - MDN Web Docs
The :scope CSS pseudo-class represents elements that are a reference point for selectors to match against.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, thank you.
Hi @konclave!
You could use the
:global
modifier in order to style all anchor tags inside of yournav
.