Let's hack `<style>`
See original GitHub issueIn:
<template>
<h1>hello</h1>
</template>
<script>
export default {
props: ['color', 'fontSize']
}
</script>
<style scoped>
h1 {
color: eval("color");
font-size: eval("fontSize * 2");
}
</style>
Out:
<template>
<h1 :style="{'--v0': color, '--v1': fontSize * 2}">hello</h1>
</template>
<script>
export default {
props: ['color', 'fontSize']
}
</script>
<style scoped>
h1 {
color: var(--v0);
font-size: var(--v1);
}
</style>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top Results From Across the Web
5 Style Hacks that Will Change Your Life | by Erin Elizabeth
Hi guys! Today I'm sharing with you a few of my styling hacks / fashion hacks ! These are 5 really simple things...
Read more >QUICK FASHION HACK | YOU WILL TURN HEADS w/o EVEN ...
Happy holiday fam! These are some quick fashion hacks that will make you turn heads and the best part is its effortless. Let's...
Read more >Styling Hacks Everyone Should Know | Get the Most Out of ...
This week i'm sharing style tips and fashion hacks I think I EVERY girl ... Let me know which style and fashion hack...
Read more >Xkcd Style Sql Injection Hack in Python
We have created a simple database. Now let's hack it. Xkcd style hack on our database. #!/usr/bin/python3 import sqlite3 db = ".
Read more >Sleeve Hacks - Melly Sews - Pinterest
Hack a sleeve design - how to change the style of a sewing pattern - Melly. mellysews · Melissa (Melly Sews) ... Let's...
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
or maybe interpolation like
?
Edit: Not friendly for editors since it is invalid css
I like this concept. I’m way more willing to adopt this method if I can continue using the style block in my SFCs.
Perhaps setting a new type will help make it more obvious to fresh eyes on the project what’s going on too. Like
<style lang="styled" scoped>
or something like that.